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 withlsblk
the device name,mkdir /mnt/cdrom
and mount it there) - gui: the CD is usually automounted,
df
will reveal the path
sh /media/cdrom/VBoxLinuxAdditions.run
and follow the instructions on screen.
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.