When a guest system is installed on VirtualBox, several features are usually disabled or missing. In addition, the screen size is usually scaled-down instead of being fullscreen and this, among many other shortcomings, impacts the overall user experience. VirtualBox Guest Additions is a set of device drivers and applications which are designed to help achieve enhanced usability and improve the overall user experience of the guest system.
At a glance, VirtualBox guest Additions provide the following salient enhancements:
- Shared clipboard between the guest vm and the host system.
- Smooth mouse pointer integration.
- Enhanced and accelerated video performance.
- Shared folders which enable sharing of files and directories between host and guest
- Time synchronization between the host and the guest.
- Additional generic communication channels that offer better control of the guest by the user.
Prerequisites
This guide requires you to have installed Debian 11 on VirtualBox hypervisor. This is the guest system. In addition, ensure that you have a sudo user already configured on your virtual machine instance.
Step 1: Update Debian 11
It’s always a good idea to begin by updating the system by upgrading all the packages. But first, refresh the package lists.
$ sudo apt update
Next upgrade the system including the kernel and existing packages.
$ sudo apt upgrade
Step 2: Install dependencies
To install VirtualBox, a couple of dependencies are required. You need to install the DKMS (Dynamic kernel Module Support) program that is used for generating kernel modules, the kernel headers, and build tools.
$ sudo apt install dkms linux-headers-$(uname -r) build-essential
The command installs Linux headers , compiler tools, and several other packages.
Step 2: Install VirtualBox Guest Additions
Once the installation of the dependencies is done, head back to the Virtual machine’s control panel and hit the ‘Settings’ tab.
Navigate and hit ‘Devices’ and from the pull-down menu, select the ‘Insert Guest Additions CD Image’ option
This inserts the VirtualBox Guest Addition ISO file on the guest machine. You can verify this by launching the File Manager and navigating to the left sidebar.
The next step is to mount it in /mnt directory as shown.
$ sudo mount /dev/cdrom /mnt
You can confirm the contents as follows using the ls command.
$ ls -l /mnt
Of interest is the VBoxLinuxAdditions.run script. This is what we need to run. So, navigate to the /mnt directory.
$ cd /mnt
And run the installation script.
$ sudo ./VBoxLinuxAdditions.run
Finally, restart your Debian 11 instance to finish running the Guest Additions kernel modules.
$ sudo reboot
Upon logging in, you’ll notice that your guest has scaled to full screen. You can now enjoy other features provided by the Guest Additions such as shared clipboard and file sharing with the host system.
If you came this far, then congratulations! You have successfully installed VirtualBox Guest Additions on Debian 11.