How to Install VirtualBox Guest Additions on Debian 11

Last updated: August 10, 2022

VirtualBox Guest Additions is a set of drivers and applications to improve the performance of the guest operating system on VirtualBox. It provides functionalities such as a shared clipboard, Drag & Drop, enables 3D acceleration support, and more.

In this tutorial, we learn how to install VirtualBox Guest Additions on Debian 11 guests.

Install Guest Additions on Debian Guest

VirtualBox Guest Additions comes as an Image ISO file named VBoxGuestAdditions.iso. This file comes along with VirtualBox and is supported for almost all guests. Mainly two steps involved - attached ISO image to the Optical CD drive and then mount to the guest OS to install.

1. First Start the Debian guest virtual machine in the VM VirtualBox Manager. Login to Debian using the sudo user and Update your Debian guest operating system.

sudo apt update

2. Install the required packages for building modules:

sudo apt install build-essential dkms linux-headers-$(uname -r)

3. On the Virtual machine go to Devices and from the drop-down menu choose "Insert Guest Additions CD Image".

Insert Guest Additions CD Image
Insert Guest Additions CD Image

If it worked, you can see VBoxguestAdditions.iso got attached in the Storage settings of the specific Guest VM in VirtualBox Manager.

Storage Settings
Storage Settings

4. Now let's mount the above .iso from the CD-ROM device to a local directory. For this, we will create a new directory.

Open the terminal on the Debian guest OS, type:

$ sudo mkdir -p /mnt/guestadditions
$ sudo mount /dev/cdrom /mnt/guestadditions
mount guest additions from cdrom
mount guest additions from cdrom

5. Change to the new directory and run the VBoxLinuxAdditions.run script. Running this script will install Guest Additions.

cd /mnt/guestadditions
sudo sh ./VBoxLinuxAdditions.run --nox11
Install Guest Additions
Install Guest Additions

6. Reboot the Debian Guest OS to make the change effective:

$ sudo shutdown -r now

7. To verify the installation was successful by listing the loaded kernel modules.

$ lsmod | grep vboxguest

Output:

vboxguest             413696  7

This indicates VirtualBox kernel module is loaded and installation is successful.

Conclusion

In this tutorial, we learned how to install VirtualBox Guest Additions on Debian 11. Hope you enjoy the enhanced Guest OS with Guest Additions.

About The Author

Bobbin Zachariah

Bobbin Zachariah

Bobbin is a seasoned IT professional with over two decades of experience. He has excelled in roles such as a computer science instructor, Linux system engineer, and senior analyst. Currently, he thrives in DevOps environments, focusing on optimizing efficiency and delivery in AWS Cloud infrastructure. Bobbin holds certifications in RHEL, CCNA, and MCP, along with a Master's degree in computer science. In his free time, he enjoys playing cricket, blogging, and immersing himself in the world of music.

SHARE

Comments

Please add comments below to provide the author your ideas, appreciation and feedback.

Comments Off on How to Articles