VirtualBox Guest Additions won't install on Ubuntu Server 12.04

I am trying to install VitrualBox's Guest Additions on Ubuntu Server 12.04, but keep getting an error. I am using the following command sudo ./VBoxLinuxAdditions.run --nox11 and get the following error:

enter image description here


Solution 1:

I had the same problem when running the installer from the vbox additions iso, but running sudo apt-get install virtualbox-guest-utils worked fine. I did an apt-cache search virtualbox to verify the name of the package before attempting the install.

I did however, run the command suggested by Gregory above (as I was trying to get the installer to work from the iso, which it never did), but that may or may not have had an impact.

If you want to avoid the installing X11 dependencies use:

sudo apt-get install --no-install-recommends virtualbox-guest-utils && sudo apt-get install virtualbox-guest-dkms

Edit: See comment below.

Solution 2:

I had the same issue. Install some additional packages and every thing will be fine:

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