Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've recently installed Ubuntu on virtualbox. Now I want to install the guest additions. I started up my Ubuntu guest OS, clicked "Devices" and chose "Install Guest Additions". Nothing happened. What am I doing wrong?

EDIT: Nothing happened = I don't see the CD icon on my desktop.

share|improve this question

6 Answers

up vote 45 down vote accepted

Installing Guest additions from the repositories

In case we have installed the OSE edition of Virtual Box from the repositories we can add the guest additions from the repositories.

  • For an Ubuntu guest
    Install the package virtualbox-guest-additions Install virtualbox-guest-additions in the guest Ubuntu. This is a precompiled version of the guest additions that may also be installed in the PUEL version of Virtual Box (or when running Virtual Box on another host OS). They may not be up to date but will usually run in later versions of Virtual Box too. This procedure may be useful when building the Guest Additions fail (e.g. in not yet fully supported new or pre-release kernels installed for testing in Virtual Box).

  • For another guest OS
    The Guest Additions CD .iso file to mount and install in another OS (non-Ubuntu Linux distribution, Windows, Solaris, OS/2) is provided by the package virtualbox-guest-additions-iso Install virtualbox-guest-additions-iso to be installed in the host Ubuntu. After mounting in the guest install the additions by running the appropriate installation script from this CD.

Installing Guest Additions from Virtual Box Manager

After selecting Devices -> Install Guest Additions or by pressing Host+D from the Virtual Box Manager the Guest Additions CD .iso will be loaded but not installed in your guest OS. To install we need to run the installer script VBoxLinuxAdditions.run as root or from the Autorun Prompt (see below),


GNOME classic (10.04 LTS)

To install the Guest Additions we will have a CD icon on our desktop as soon as the virtual drive is mounted:

alt text

Next step is to run the autorun.sh script (as root) on this mounted CD either by opening the drive or by choosing "Open With Autorun Prompt" from the right-click context menu as depicted above. This will build and install the vbox kernel modules needed.


Unity (> 11.04)

The guest additions is mounted as a virtual CD visible on the launcher:

enter image description here

In case the system is set up to autorun a CD it should just open the following autorun dialogue (if not select the CD symbol, choose open, then choose Open Autorun Prompt)

enter image description here

After having entered your credentials for root access the guest additions will build as seen from the terminal output:

enter image description here

Press Return to close the terminal.


Note 1
Guest Additions need a reboot of your guest OS to take effect.

Note 2
In some systems the Virtual Box Guest Additions CD icon may not be shown on the desktop, but will be accessible from the Places menu. If the CD still was not there you may have to manually add the VBoxGuestAdditions.iso as a CD-ROM in the Virtual Box Manager Storage menu. In an Ubuntu host the disk image is in /usr/share/virtualbox/VBoxGuestAdditions.iso.

Note 3
In some systems (e.g. when running Xubuntu guests) we may not have an Autorun Prompt for the mounted CD. Then we can install the guest additions by opening a terminal on the mounted guest additions .iso to run sudo ./VBoxLinuxAdditions.run. In Lubuntu guests we additionally need to install the GNU C compiler (gcc Install gcc) and the make Install make utility in the guest system to be able to compile the guest additions.

Note 4
Running DKMS in the guest OS will keep Guest Additions installed after a guest kernel update. It is not a prerequisite for Guest Additions but if used it should be installed before we install the Guest Additions.


Installing Guest Additions from a Terminal

In case Guest Additions are not installed properly we may not be able to boot to the GUI. In this case we need to boot holding the Shift key to access the Grub menu where we access a root shell as depicted in the following question (we do need to mount the filesystem read/write to proceed):

The Guest Additions .iso file needs to be installed on /dev/cdrom from the Virtual Box Manager (see above). We then may install Guest Additions by typing the following commands:

mount /dev/cdrom /mnt              # or any other mountpoint
cd /mnt
./VBoxLinuxAdditions.run
reboot
share|improve this answer
I came across this answer while trying to install Guest Additions on Ubuntu Server. One step is missing if you need to install on server: run sudo apt-get install dkms first. (ref virtualbox.org/manual/ch04.html#idp19765808) – Charles Roper May 23 '12 at 7:30
I tried your solution for ubuntu 12.10 server as guest and mac os x as host. Virtual box is 4.2.6. I am unable to to get the shared folders to work. somehow the guest additions are not working. Even Devices > Install Guest Additions did not work too. Not even the package virtualbox-guest-additions helped. Every attempt to run the iso GuestAdditions.iso does NOT lead to the iso showing up under /media/cdrom. Please advise. – kimsia Jan 3 at 10:43
@kimsia: you need to mount the .iso in your server first. After that you can install the GA with sudo ./<mountpoint>/VBoxLinuxAdditions.run – Takkat Jan 3 at 11:16
@Takkat the mounting cannot work at all. In other news, i finally found a way to make everything work.superuser.com/a/527508/8184 so thank you for answering me. Appreciate it greatly :) – kimsia Jan 3 at 11:21
@kimisa: please note that the method you linked to will not install the most recent guest addition but those available from Ubuntu repositories (which would be 4.1.18 for 12.10 and 4.1.22 for 13.04). In case your host Virtual Box release is newer it is not recommended to run older versions of Guest Additions (but they will mostly still work). – Takkat Jan 3 at 11:31

The standard "virtualbox-guest-additions" package on the .iso provided by Oracle, has general tools for different Guest Operating Systems...

However, Ubuntu has its own dedicated Ubuntu-specific Guest Addon package(s)...
named virtualbox-ose-guest-dkms and ..-x11 and ..-utils .

These 'virtualbox-ose-guest-*' packages are DKMS aware.. "(DKMS is a framework designed to allow individual kernel modules to be upgraded without changing the whole kernel.)"

Here is the link to a question I asked 5-6 months ago on this issue... How can I get Compiz to work in a VirtualBox VM

share|improve this answer

You could also try the following (this worked for me after I had to reinstall the Guest Addtitions after Update Manager killed them). Solution found here:

http://www.unixmen.com/install-guest-addition-in-ubuntu-1010-maverick-meerkat-fix/

In summary:

sudo apt-get update
sudo apt-get install build-essential linux-headers-$(uname -r)
sudo apt-get install virtualbox-ose-guest-x11

This found and updated the correct version of the VirtualBox Guest Additions and my system seems to work properly again, and I'm assuming this will also work if Guest Additions are failing to install from the menu item.

One other thing of note. I originally tried to run this under the fish shell - make sure you're using bash (i.e. type "bash" into the terminal before you start).

share|improve this answer
your answer helped even though i was installing in a fresh installation ubuntu server. thank you. superuser.com/questions/527507/… – kimsia Jan 3 at 11:05

The virtualbox-guest-additions package has to be installed. Furthermore, it may appear that nothing has happened, but all the "Install Guest Additions" button do is mounting the cdrom. You should open the File manager (Nautilus / Dolphin), select the "CD device" and run the installer.

share|improve this answer

In VirtualBox, under Machine -> Settings -> Advanced, make sure that Shared Clipboard is enabled or set to bidirectional.

share|improve this answer

In windows xp case, install SP2 before.

share|improve this answer
Could you elaborate a little more about this? Why does it fix it. – txwikinger Mar 13 at 14:17
@txwikinger I just tried to install the Guest Additions without SP2 and it didn't work. Then I install SP2 and it worked. sorry I don't know why.. – tirengarfio Mar 14 at 12:44
The Virtual Box Manual states that Guest Additions are supported for all Windows XP servicepacks. – Takkat Mar 15 at 11:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.