Skip to content

Instantly share code, notes, and snippets.

@otzoran
Last active August 29, 2015 14:27
Show Gist options
  • Save otzoran/a704d5edbd7c4846d38b to your computer and use it in GitHub Desktop.
Save otzoran/a704d5edbd7c4846d38b to your computer and use it in GitHub Desktop.
Installing Guest Additions on Debian Ubuntu Mint etc.

Installing Guest Additions on Debian

Follow these steps to install the Guest Additions on your Debian virtual machine:

sudo -i
apt-get update && apt-get upgrade
apt-get install build-essential module-assistant
# Configure your system for building kernel modules by running:
m-a prepare

Click on Insert Guest Addition CD image from the VM's Devices menu, then:

  • server/no-gui: mount /media/cdrom (or check with lsblk the device name, mkdir /mnt/cdrom and mount it there)
  • gui: the CD is usually automounted, df will reveal the path

Run the script (toujours root):

sh /media/cdrom/VBoxLinuxAdditions.run  

and follow the instructions on screen.

Possible Failures

DKMS module compliation fails

And the error message sends you to some file under /var/log AFAIR, that isn't of any help.
On one VM there was a mismatch between the kernel version (uname -r) and the directory names in 2 places:

  • under /lib/modules/${kernel_version}
  • under /usr/src/{kernel_version}

This was apparent as the symlinks in /lib/modules were broken (ls --color paints them in red). I manually created the missing symlinks, leaving the bad ones in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment