The following steps show how to install VirtualBox 4.1.14 Guest Additions onto CentOS 6.2 x64. First, you need to update to the latest kernel using yum update. Then you need to install the kernel header files and a compiler using yum install. You need to be root, so at the terminal do the following:
su root
yum update
...
yum install kernel-devel gcc
...
exit
You need to restart the virtual machine then before continuing. Once you’ve restarted you can mount the Virtual Box 4.1.14 Guest Additions CD by pressing Host+D (on MacOS at least). To run the install script you need to be root again, so at the terminal do:
su root
/media/VBOXADDITIONS_4.1.14_77440/VBoxLinuxAdditions.run
...
exit
If for some reason something goes wrong I recommend checking that you have the right kernel / kernel headers installed using:
yum info kernel
yum info kernel-devel
These steps should resolve the following error message:
VirtualBox Guest Additions installer
Building the VirtualBox Guest Additions kernel modules [FAILED]
Your system does not seem to be set up to build kernel modules.