We use CentOS VMs at work to emulate our production environment - and it took me a while to figure out how to get the VirtualBox Guest Additions to build reliably on CentOS 6.4/5. This is what I’ve currently settled on as a reliable method.
First, make sure that you’ve got the kernel headers and tools installed that you need to build stuff:
$ sudo yum update -y
$ sudo yum install gcc kernel-devel kernel-headers dkms make bzip2 perl
Make sure that you’ve only got the current set of kernel headers installed - the one for the kernel you’re actually running. Having more than one set installed prevents this working properly. Running this should show you one version of each kernel package:
$ rpm -qa | grep kernel | sort
It should look something like this:
dracut-kernel-004-336.el6_5.2.noarch …