Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Saw-mon-and-Natalie/ffbbf72cd490b8ad84335fce04d18fd4 to your computer and use it in GitHub Desktop.
Save Saw-mon-and-Natalie/ffbbf72cd490b8ad84335fce04d18fd4 to your computer and use it in GitHub Desktop.
Adding Virtual Box Guest Additions to CentOS 7 to access shared folders from host OS to guest OS

Virtual Box Manager > CentOS > Settings >

  • Inside Storage make sure that the VBoxGuestEditions.iso is loaded on the optical drive
  • Inside Shared Folders configure your shared folder structure from the host OS to the guest OS
mkdir /mnt/cdrom
sudo mount /dev/cdrom /mnt/cdrom

# Red Hat Package Manager
# rpm --upgrade --hash --verbose PACKAGE_NAME
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# or
# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

# Yellow dog updater for CentOS
yum install gcc kernel-devel kernel-headers dkms make bzip2 perl

# uname -r, --kernel-release
# @return: kernel release
KERN_DIR=/usr/src/kernels/`uname -r`

export KERN_DIR

cd /mnt/cdrom
sudo ./VBoxLinuxAdditions.run

shutdown -r 0

Now you can use VBoxControl command:

VBoxControl sharedfolder list
VBoxControl --help
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment