Install VBox Guest Addons And Auto Mount VBox Shared Folders

1. Mount the Guest Addons in VirtualBox:
Devices >> Insert Guest Additions

 

mount /dev/cdrom /mnt
cd /mnt
./VBoxLinuxAdditions.run --nox11

 
2. if you get this error: "Unable to find the sources of current Linux kernel", then:

 

yum install kernel-devel
yum group install "Development Tools"
yum install kernel-headers-$(uname -r)
./VBoxLinuxAdditions.run --nox11

 

 

3. Add and auto mount vbox shared folder:

 

mount | grep vbox

 

 

vim /etc/fstab

Append the following and reboot:

/media/sf_vb-share /desired/mount/point bind defaults,bind 0 0

 
4. Reference:
http://www.turnkeylinux.org/docs/virtualbox-guest-addons
http://www.cyberciti.biz/faq/centos-rhel-7-redhat-linux-install-gcc-compiler-development-tools/
https://forums.virtualbox.org/viewtopic.php?f=7&t=47862
https://forums.virtualbox.org/viewtopic.php?t=15868