How To Install Oracle VirtualBox on Debian 11

Friends, in the Linux world although KVM is making great strides, many still prefer Oracle VirtualBox on Debian 11. So today I will explain how to install it using several different methods.

What is Oracle VirtualBox?

VirtualBox is a software created by Oracle with which we can create virtual machines. Thanks to these virtual machines, we will be able to simulate operating systems either for a productive environment or for domestic purposes.

Although VMWare is the most professional option possible, VirtualBox is focused on being easy to use but not without advantages. In addition to this, any user can use VirtualBox because it is free, which is not possible with VMWare.

So many novice users, and not so many, use VirtualBox to do their work and testing there. Let’s install it.

Method 1: Installing Oracle VirtualBox on Debian 11 using its official repositories

Fortunately, we have many methods to get Oracle VirtualBox on Debian 11. In this first method, we will add the Oracle repository for VirtualBox.

Open a terminal and update the whole system

sudo apt update
sudo apt upgrade

Thereafter, you have to install some necessary packages.

sudo apt install gnupg2 wget

Thereafter, you will have to add the GPG key of the repository in question.

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -

Now add the Oracle repository for Debian 11.

echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian bullseye contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list

APT Refresh

sudo apt update

Now install the headers for the kernel you are using. This step is vital for VirtualBox to work.

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

After this, you will be able to install VirtualBox without any problems.

sudo apt install virtualbox-6.1

Then, when the process finishes, you can run it with the command

virtualbox

Or from the main menu.

Method 2: Installing VirtualBox using DEB packages

If you want to avoid adding a repository to the system or want a more direct way to get the application, you can then download the DEB from the official download page.

Or by running this command

wget https://download.virtualbox.org/virtualbox/6.1.26/virtualbox-6.1_6.1.26-145957~Debian~bullseye_amd64.deb

You can then install it by running

sudo apt install ./virtualbox-6.1_6.1.26-145957~Debian~bullseye_amd64.deb

You can also run the application using the command mentioned in the previous method.

Recommended: Install VirtualBox Extension pack

Although this step is optional, the truth is that it is highly recommended because the extension pack allows us to gain features such as improved screen resolution in virtual machines, data sharing and others.

Normally, we download and install the extension pack for the version we have. This is the best way to avoid issues.

Download with wget the extension pack for the version we have downloaded.

wget https://download.virtualbox.org/virtualbox/6.1.24/Oracle_VM_VirtualBox_Extension_Pack-6.1.24.vbox-extpack

And now install it by running

sudo vboxmanage extpack install --replace Oracle_VM_VirtualBox_Extension_Pack-6.1.24.vbox-extpack

If you use a graphical interface, you can install it by simple double-clicking on the file.

Accept the license terms

Do you agree to these license terms and conditions (y/n)? Y

And the process will finish normally.

Finally, it is advisable to have the current user added to the Virtualbox run group.

sudo usermod -aG vboxusers $(id -un)

With this, VirtualBox will be installed and ready to use.

Uninstalling VirtualBox on Debian 11

To uninstall VirtualBox, we just need to execute the following command line

sudo apt remove virtualbox-6.1

After this, there will be no trace of VirtualBox left on the system. If you have added the repository, then remove it as follows.

sudo rm /etc/apt/sources.list.d/virtualbox.list

And then refresh APT to apply the changes.

sudo apt update

Conclusion

Thanks to this post, you now know how to install VirtualBox on Debian 11 using several methods. In addition to this, if you no longer want to use it, you have also learned how to uninstall it.

Share this post and help us grow.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top