Notes for future me: how to setup the VirtualBox Guest Additions for Ubuntu (14.04 at time of writing)

In this particular case, I want to mount /backups to a shared folder so that backups can be dumped onto the host system.

Install the build pre-reqs

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install dkms build-essential linux-headers-$(uname -r)

Mount the ‘virtual’ CD with the guest additions. The CD can be ‘inserted’ via the Devices>Insert Guest Additions in VirtualBox

sudo mkdir -p /mnt/cdrom
sudo mount /dev/cdrom /mnt/cdrom
cd /mnt/cdrom

Build/Load the kernel module that adds support for vboxsf

sudo sh ./

At this point, if you’ve already setup a shared folder in the VirtualBox UI, if you run th `mount’ command, it should show the shared folder mounted at /media/sf_FolderName

If you try to cd to that directory, you’re going to encounter a permission error. To fix that, add the appropriate users to the vboxsf group (if you want to keep using this mount point)

If you want to change the mount point (in this case, to /backups), do the following:

# Create the mount point. In this case, /backups
sudo mkdir /backups

# Ensure the correct users have access 
# (tightening perms recommended...)
sudo chmod a+rwx /backups

# Mount the Folder - this assumes that the Shared Folder is named 'Backups' in the host OS.
mount -t vboxsf Backups /backups

# To make the mount point permanent, add it to /etc/fstab
Backups /backups vboxsf defaults 0 0