Trying to install the VirtualBox guest additions in a non desktop system I encounter errors. Luckily the solution wasn’t too difficult to fix.
Use the Virtualbox menu to install the guest additions CD image
Mount the Guest Additions CD.
sudo mount /dev/cdrom /media/cdrom
Install kernel build software:
sudo apt-get install -y dkms build-essential linux-headers-generic linux-headers-$(uname -r)
Run the installer on the CD:
sudo sh /media/cdrom/VBoxLinuxAdditions.run
Expect the “Installing the Window System drivers” to fail because on a server X windows (GUI) is not typically installed and therefore is not relevant.
Not as simple as the desktop version but for a non GUI installer it should not be beyond many people who are familiar with command line. It’s a shame Oracle hasn’t improved the script for the server edition.
Installing VirtualBox Guest Additions on Ubuntu Server