OK, so you have a minimal install of CentOS in VirtualBox and you want to install the Guest Addons to help your VM keeps its clock correct, and share folders with your host OS. What are the dependencies? How do you get this to install?
These directions work for CentOS 5, 6 and 7.
Install some packages needed to build the kernel module.
yum install epel-release yum install dkms gcc make bzip2 perl yum install kernel-devel-$(uname -r)
We need EPEL to get
dkms to ensure that the addons are rebuild when we upgrade the kernel in the future.
We do the fancy bit with the
uname to ensure we get the right version of
kernel-devel for the currently running kernel. If you’ve updated the kernel since booting you should reboot before installing
kernel-devel and the addons or else you might have some problems building them.
Mount the Guest Addons CD and run the installer.
mkdir /mnt/cdrom mount /dev/sr0 /mnt/cdrom/ /mnt/cdrom/VBoxLinuxAdditions.run
Answer yes a few times, and you are done!