Learn how to easily install VirtualBox on Debian 12 (Bookworm) with our step-by-step guide, and start virtualizing your systems today!
If you’re looking to explore the virtualization world and harness the power of running multiple operating systems on a single machine, you’ve come to the right place.
VirtualBox is a versatile and widely-used open-source virtualization software that allows you to simultaneously run various operating systems, such as Windows, Linux, and macOS, on a single host machine.
In this article, we’ll walk you through installing VirtualBox on Debian 12 (Bookworm), setting up virtual environments, and managing virtual machines effortlessly.
Install VirtualBox on Debian 12 (Bookworm)
Although VirtualBox is primarily aimed at home users, it is also commonly utilized in professional environments. Unfortunately, it is unavailable for installation from the official Debian repositories.
But this should not bother you. There is an effortless way to install VirtualBox on your Debian 12 system, which we will show you now.
Step 1: Download and Import VirtualBox’s GPG Keys
Firstly, to ensure that the packages we receive to install the VirtualBox are genuine, we should download and import the VirtualBox signed GPG keys on our Debian 11 system.
wget -O- -q https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --dearmour -o /usr/share/keyrings/oracle_vbox_2016.gpg
Notice that the command produces no output.
Step 2: Add VirtualBox Repository for Debian 12
After importing the GPG keys, we’ll add the official VirtualBox repository to our Debian 12 system. This implies that the update package will be made available with the rest of your system’s regular updates if a new version is released.
To accomplish it, type the command shown below.
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/oracle_vbox_2016.gpg] http://download.virtualbox.org/virtualbox/debian bookworm contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
Step 3: Run System Update
Before we proceed with VirtualBox installation on our Debian 12 system, we should update the list of available packages. So, run the below command to update the APT repositories index.
sudo apt update
As you can see, our new VirtualBox repository is now available and ready to be used.
Step 4: Install VirtualBox on Debian 12 (Bookworm)
Everything is already prepared for the actual installation. Now, to install VirtualBox on Debian 12, run the following commands:
sudo apt install virtualbox-7.0
That’s all. The VirtualBox is installed and ready for use on your Debian 12 Linux system.
Step 5: Install VirtualBox Extension Pack (Optional)
This is an optional step, but I strongly encourage it because it will make working with VirtualBox on your Debian system more straightforward and convenient.
VirtualBox Extension Pack unlocks many great features, such as:
- USB 2 and USB 3 support
- VirtualBox Remote Desktop Protocol (VRDP)
- Host webcam passthrough
- Disk image encryption with AES algorithm
- Intel PXE boot ROM
However, one peculiarity should be highlighted here. The VirtualBox Extension Pack’s version is recommended to match the version of VirtualBox installed on your Debian 12 system.
So, to verify the exact one of the installed locally VirtualBox, you can use
vboxmanage, a build-in VirtualBox’s command:
vboxmanage -v | cut -dr -f1
As you can see, the version of Virtualbox installed is 7.0.10. Therefore, the Extension Pack with the same version must then be downloaded.
If your installation is different, replace both places containing 7.0.10 in the command below with the current version. In addition, you can also go straight to the downloads page and look at the available versions.
Next, to install the VirtualBox Extension pack, run the
vboxmanage command as follows:
sudo vboxmanage extpack install Oracle_VM_VirtualBox_Extension_Pack-7.0.10.vbox-extpack
When prompted to agree the Oracle’s license terms and conditions, type “y” to confirm and press “Enter.”
You can verify that the extension pack was installed correctly by running the following:
vboxmanage list extpacks
Step 6: Add User to the vboxusers Group
Before using VirtualBox, add your user account to the
vboxusers group. This is quick and simple to accomplish by running:
sudo usermod -a -G vboxusers $USER
Now perform a reboot. After login, check that you are in the
vboxusers group with this command:
Step 7: Running VirtualBox on Debian 12
You can start using VirtualBox by launching it from the desktop environment’s application menu.
VirtualBox provides an invaluable platform for developers, IT professionals, and enthusiasts to test applications and OSes in isolated environments, safeguarding the host system from potential conflicts and adverse effects.
Installing VirtualBox on Debian 12 (Bookworm) is a straightforward process that empowers users to create and manage virtual environments efficiently.
By following the step-by-step guide provided, users can harness the full potential of VirtualBox, enabling them to run multiple operating systems on a single machine seamlessly.
In addition, we also recommend checking the official documentation for individuals who want to learn more about the features offered by VirtualBox and how to use them effectively.
Thanks for your time! Your feedback and comments are most welcome.