Installation involves the following steps:
1.
Before installing the Guest Additions, you will have to prepare your guest system for building external kernel modules. This works similarly as described in the section called “The VirtualBox kernel module”, except that this step must now be performed in your Linux guest instead of on a Linux host system, as described there.
Again, as with Linux hosts, we recommend using DKMS for Linux guests as well. If it is not installed, use this command:
sudo apt-get install dkms
Install DKMS before installing the Linux Guest Additions.
2.
Mount the VBoxGuestAdditions.iso file as your Linux guest's virtual CD-ROM drive, exactly the same way as described for a Windows guest in the section called “Installation”.
3.
Change to the directory where your CD-ROM drive is mounted and execute as root:
sh ./VBoxLinuxAdditions-x86.run
In a 64-bit Linux guest, use VBoxLinuxAdditions-amd64.run instead.
The VirtualBox Guest Additions contain several different drivers. If for any reason you do not wish to set them all up, you can install the Guest Additions using the following command:
sh ./VBoxAdditions.run no_setup
After this, you will need to at least compile the kernel modules by running the command
/usr/lib/VBoxGuestAdditions/vboxadd setup
as root (you will need to replace
lib
by
lib64
on some 64bit guests), and on older guests without the udev service you will need to add the
vboxadd
service to the default runlevel to ensure that the modules get loaded.
To setup the time synchronization service, run the command
/usr/lib/VBoxGuestAdditions/vboxadd-service setup
and add the service vboxadd-service to the default runlevel. To set up the X11 and OpenGL part of the Guest Additions, run the command
/usr/lib/VBoxGuestAdditions/vboxadd-x11 setup
(you do not need to enable any services for this).
To recompile the guest kernel modules, use this command:
/usr/lib/VBoxGuestAdditions/vboxadd setup
After compilation you should reboot your guest to ensure that the new modules are actually used.