13

I have inserted the CD and navigated to it in the terminal.

But when I run ./autorun.sh it doesn't give any useful output, and it doesn't appear to have installed.

9

You need to run VBoxLinuxAdditions.run as root, not autorun.sh

Once you've inserted the Guest Additions ISO, open Files and open the disc from the sidebar. Then, right-click in the background of the window where autorun.sh is and select Open in > Terminal. Now you can run the following command to install Guest Additions:

sudo ./VboxLinuxAdditions.run

For reference, here is example output:

Verifying archive integrity... All good.
Uncompressing VirtualBox 4.3.28 Guest Additions for Linux............
VirtualBox Guest Additions installer
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules ...done.
Doing non-kernel setup of the Guest Additions ...done.
Starting the VirtualBox Guest Additions ...done.
Installing the Window System drivers
Installing X.Org Server 1.16 modules ...done.
Setting up the Window System to use the Guest Additions ...done.
You may need to restart the the Window System (or just restart the guest system)
to enable the Guest Additions.

Installing graphics libraries and desktop services components ...done.
| improve this answer | |
  • Maybe we should add something about the ability to right click in the ISO in files and open the terminal here? – Lewis Goddard Jul 1 '15 at 13:29
  • you can find the files in /media/[username] – Summer-Time Oct 8 '16 at 18:41
1

It should also be possible to install the guest utilities from the repositories. You can either install via "Software Center" or via shell. The package is named virtualbox-guest-x11.

To install via shell open the shell with Super + T and enter sudo apt-get update to update the repository information and sudo apt-get install virtualbox-guest-x11 to install the guest utilities.

There is also a package named virtualbox-guest-utils for systems without desktop environment. But elementary is usually installed with its desktop environment.

| improve this answer | |
  • Although repo installer is easiest possible option, it may become outdated. In that case would not be better to download latest or use the provided ISO? – Mashimom Jun 30 '15 at 23:50
  • @Mashimom The provided ISO will always match the version of Virtualbox, so stops you using outdated packages and from having version incompatibility problems. – Lewis Goddard Jul 1 '15 at 13:27
  • @Mashimom Lewis is right. But this also depends on your host system. If you are also using elementary as the host (or the corresponding Ubuntu LTS release) it makes absolutely no difference and you can just use the version from the repositories. – brejoc Jul 3 '15 at 20:28
0

Tim has provided the correct answer, but you may find that many things go wrong. I did a fresh install of elementary OS freya this morning and would like to share the errors I came across and how to solve them.

Problems Inserting the Guest Additions iso & Mounting It

Problem Description: After installing elementary in Virtualbox, you may find the screen resolution is tiny. This is a common case across guest OS's in Virtualbox in my experience. To solve this problem, you need to install the Virtualbox Guest Additions in the guest OS (elementary). However, this can be a task in itself, so I've dedicated this section purely to inserting the Guest Additions and mounting it.

Solution:

  1. Download the guest additions iso that matches your Virtualbox version. (Download on the guest, not the host!)
    • Find your Virtualbox version.
      • Launch Virtualbox in your host OS
      • Click Help > About Virtualbox...
      • Note the version (Mine was 4.3.12)
    • Navigate to http://download.virtualbox.org/virtualbox/ using Midori and select the folder that matches your version number. (Again, mine was 4.3.12)
    • Look for the file called VBoxGuestAdditions_X.X.XX.iso (Replacing the X's with your version number) and download it. (Again, make sure you are downloading it to your guest, not the host!)
  2. Mount the iso

    • Open a terminal in elementary
      • Click Applications in the upper left and search for "Terminal"
    • Run the following commands:

    cd ~/Downloads/ ls

You should see VBoxGuestAdditions_X.X.XX.iso. If not, find out where your download went.

sudo mkdir /mnt/VBGA/
sudo mount VBoxGuestAdditions_X.X.XX.iso /mnt/VBGA/
cd /mnt/VBGA/
sudo ./VBoxLinuxAdditions.run

Now we have reached where Tim had us before. However, sometimes the installation doesn't simply go smoothly. I encountered an error during the install, and this is how I fixed it.

Troubleshooting Guest Additions Install

The first step after installing a new linux system should always be to update. Run the following commands:

sudo apt-get update
sudo apt-get upgrade

Now that we're updated, you may need to install the following if you're getting an error regarding modules or missing headers.

sudo apt-get install module-assistant
sudo m-a prepare

After running that last command, I was able to do $ sudo ./VBoxLinuxAdditions.run and successfully complete the install. The shared folders did not install correctly, and that is another issue that I cannot help you with at this time. However, the screen resolution does get fixed and you should be able to use elementary at full resolution. :)

| improve this answer | |
  • I'm not sure you should need to download the Guest ISO, does it not come with VirtualBox? I've always just selected "Insert Guest Additions" from the menu. – Lewis Goddard Jul 1 '15 at 13:28
  • I was running into problems trying to mount the iso using the Devices > Insert Guest Additions method, which is why I ended up just downloading it. I thought this way was more foolproof. – TW80000 Jul 2 '15 at 4:08
  • It seems massively more complicated. The only problem I ever experienced like that within elementary was mounting it could take a while, like, grab a snack. – Lewis Goddard Jul 2 '15 at 6:56
  • I wrote this because I experienced problems you didn't and wanted to help people solve them. I understand that this must seem complicated if your install went correctly, but mine didn't. – TW80000 Jul 6 '15 at 2:19
  • My point was that this should probably not be recommended, as a clean install is likely to fix the issue unless it is within the host. – Lewis Goddard Jul 6 '15 at 17:25