Installing VirtualBox Additons on Ubuntu Server

I have a number of Ubuntu 14.04 virtual machines installed under VirtualBox running on Windows 8.1 and occasionally I find it useful to have the VirtualBox additions installed. Unfortunately for me the documented process doesn’t seem to work. Whenever I mount the ISO image using Devices –> Insert Guest Additions CD Image… I find that /media/cdrom is empty whereas you would expect to find the install script. This article explains how I install the additions.

First off perform an update:

sudo apt-get update
sudo apt-get dist-upgrade

Then install the necessary tools and prepare the system:

sudo apt-get install build-essential module-assistant
sudo m-a prepare

From the virtual machine menu select Devices –> Insert Guest Additions CD Image…. This will place the virtual CD in the /dev/sr0 device which is all known as /dev/cdrom. According to the official instructions this should appear in /media/cdrom but that doesn’t seem to work for me. So make a new directory to receive the mouth and manually mount the image then install the guest additions:

cd /media
sudo mkdir additions
sudo mount /dev/cdrom /media/additions

The guest additions modules will then be built and installed. If you are running the server version of Ubuntu as I am you’ll notice that it skips the section where it installs the windowing system additions as X isn’t installed.