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 full screen 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.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related VirtualBox queries on any Linux system.
In this context, we shall look into how to install the VirtualBox guest additions in Debian 11.
Before proceeding with the procedure, ensure that you have a sudo user already configured on your virtual machine instance.
Also note that you need to have installed Debian 11 on VirtualBox hypervisor before you can perform the below outlined steps.
1. Update Debian 11 system
It's always a good idea to begin by updating the system by upgrading all the packages. But first, refresh the package lists.
So to do this, simply run the system update command:
$ sudo apt update
Next upgrade the system including the kernel and existing packages:
$ sudo apt upgrade
2. Install dependencies
To install VirtualBox, a few 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
This command installs Linux headers , compiler tools, and several other packages.
3. 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
When you log 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.
This article covers how to successfully install VirtualBox Guest Additions on Debian 11. In fact, Using VirtualBox you can run multiple guest operating system simultaneously. The Guest Additions provides some useful functionalities for guest machines like a mouse pointer integration, full screen view, shared folders, shared clipboard, better and accelerated and much more.