Install VirtualBox Guest Additions on Debian Based distros
If you’re using a Debian based Linux distro, such as Ubuntu, Linux Mint, Elementary OS, etc. The following steps will work for installing VirtualBox Guest Additions.
- The first thing we need to do is install a few prerequisite packages. Open a terminal and use your system’s package manager to install them with the following commands.
$ sudo apt update $ sudo apt install build-essential dkms linux-headers-$(uname -r)
- Next, on the virtual machine window, click on Devices > Insert Guest Additions CD Image.
Inserting the Guest Additions CD Image in VirtualBox - Instead of running the software on the disc image when the prompt pops up, we will make a new directory to which we can mount the Guest Additions CD Image. Make the directory and then execute the
mountcommand to mount it.$ sudo mkdir -p /mnt/cdrom $ sudo mount /dev/cdrom /mnt/cdrom
- Now we can run the software off of the mounted Guest Additions CD image.
$ cd /mnt/cdrom $ sudo ./VBoxLinuxAdditions.run
You should now see VirtualBox Guest Additions being installed. This may take a few minutes.
The terminal output shows VirtualBox Guest Additions is being installed - Once the installation is complete, all we need to do now is reboot the system for the new changes to take effect.
$ reboot
- That’s all there is to it. When the virtual machine finishes loading back up, you’ll be able to utilize the shared clipboard, drag and drop function, automatic resolution resizing, and other features mentioned earlier. Make sure you enable the shared clipboard and drag and drop option if you wish to use them, from inside the Devices menu.
Enable the shared clipboard and drag and drop features from the Devices menu - To verify successful installation of VirtualBox Guest Additions, you can run the following
lsmodcommand in terminal. As long as you receive some output similar to that in the screenshot below, then Guest Additions is installed and running.$ lsmod | grep vboxguest
Verifying successful installation of VirtualBox Guest Additions with the lsmod command