VirtualBox Additions in CentOS 6
So, our infrastructure team has recently switched our Linux servers from RHEL to CentOS. Therefore, I decided to have my own instance in VirtualBox of the latest CentOS 6.
Downloaded the ISO from one of the mirrors: http://mirror.ovh.net/ftp.centos.org/6.0/isos/x86_64/
Created the VirtualBox with my settings, mounted the ISO and installed via the wizard of the LiveDVD. All very standard and easy.
However, out of the box, the Guest Additions failed to install using the simple Autorun.sh or even calling the VBoxLinuxAdditions.run…
So after some digging around and surfing, the work around found (assuming you are root or part of the sudoers group – check /etc/sudoers) is as follow:
At a konsole or terminal prompt, do the following steps :
- $yum -y update
(depending on the types of updates, you might to restart your machine before performing step #2) - $yum -y install gcc kernel-headers-`uname -r` kernel-devel-`uname -r`
- Now, make sure that the VirtualBoxAdditions ISO is mounted by clicking on Devices and then on Install Guest Additions on your VirtualBox window menu.
If the autorun starts, great! Let it run and it should complete without any errors.
Otherwise at the prompt,
$cd /media/VBOXADDITIONS_4.1.4_74291/
$sudo VBoxLinuxAdditions.run - Voila! That should do the trick. Restart and check that the service is running (if you cannot already tell by the resolution, sound, mouse integration, etc…)
$ service vboxadd status