Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hhankj2u/a55fd749ac01c32e40bd813679c6474c to your computer and use it in GitHub Desktop.
Save hhankj2u/a55fd749ac01c32e40bd813679c6474c to your computer and use it in GitHub Desktop.
Mount shared folder on CentOS in VirtualBox
# The VirtualBox documentation[1] for how to install guest additions
# for Linux on a virtual host is somewhat messy. So here is what
# I did to make it work.
# Install the packages required
yum update
yum install gcc kernel-devel kernel-headers make perl
reboot
# Click: Devices/Install Guest Additions...
# Mount the ISO image with the guest additions
mkdir /cdrom
mount /dev/cdrom /cdrom
# Install guest additions
/cdrom/VBoxLinuxAdditions.run
# Share a folder from the VirtualBox control panel, giving it a share name.
ls /media/sf_<share_name>
# You could always mount the directory yourself as well
mkdir /<folder_name>
mount -o uid=<userid>,gid=<groupid> -t vboxsf <share_name> /<folder_name>
[1] http://www.virtualbox.org/manual/ch04.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment