How to Install VirtualBox Guest Additions on Debian 11

Written by: Bobbin Zachariah   |   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 Zachariah is an experienced Linux engineer who has been supporting infrastructure for many companies. He specializes in Shell scripting, AWS Cloud, JavaScript, and Nodejs. He has qualified Master’s degree in computer science. He holds Red Hat Certified Engineer (RHCE) certification and RedHat Enable Sysadmin.

SHARE

Comments

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

2 Comments

2 thoughts on “How to Install VirtualBox Guest Additions on Debian 11”

  1. thank you very much. After 10 hours fighting with the guest addition your manuel solved my problems. The only thing I had to install in addition was
    error while loading shared libraries: libX11.so.6 no such file or directory

    which was solved by
    sudo apt-get install libx11-6

    thank you for your great manual

    Reply

Leave a Comment