How to Install VirtualBox 6 on Debian 11 (3 methods)

Written by: Bobbin Zachariah   |   Last updated: July 28, 2022

VirtualBox is an open-sourced, cross-platform virtualization manager application. It is owned by Oracle allows running multiple guest operating systems(OS) at the same time. VirtualBox supports guest operating systems such as Windows, Debian, Fedora, Oracle Linux, Ubuntu, and more.

Your hardware should support and enabled hardware virtualization technology to run VirtualBox.

Install VirtualBox on Debian

Here we learn 3 methods to install VirtualBox on Debian:

  • Install VirtualBox from Oracle Repository.
  • Install VirtualBox on Debian 11 using deb binary.
  • Install VirtualBox on Debian Using Installer Script.

We are using Debian 11 and installing VirtualBox version 6 on it.

Method 1: From Oracle Repository

This is the easiest way to install VirtualBox on Debian, from the Oracle repository.

Step 1. Import repository GPG key

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

Step 2. Add VirtualBox repository for Debian Bullseye

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

Step 3. Make your Debian system updated

$ sudo apt update

You can use apt-cache search virtualbox command to search which package version is available to install.

Step 4. Now, to install VirtualBox on Debian, run the following commands.

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

Once installed you can launch virtualbox from the terminal, type:

$ virtualbox

Method 2: Using the deb binary

VirtualBox binary .deb file is available VirtualBox website to download.

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

Once downloaded, install VirtualBox .deb binary package using the apt command:

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

Alternatively, you can download .deb using a browser. Then right-click on the file and choose Open With Other Application. Select Software Install and click the Select button. This opens the software installation page and then click on the Install button to start the installation.

install Virtualbox using deb file

Method 3: Using the Installer

VirtualBox comes with an installer script to install it on All Linux distributions. Before running the installer script, we will need to install dependencies:

$ sudo apt install wget build-essential python2

Open your browser and go to the official VirtualBox download page to get the latest version of VirtualBox.

Right-click on All Distributions and copy the link to the installer.

virtualbox installer

Open your terminal and using the link we copied the download installer script as follows:

$ wget https://download.virtualbox.org/virtualbox/6.1.24/VirtualBox-6.1.24-145767-Linux_amd64.run

Next, give execute permission for the installer file:

$ chmod u+x VirtualBox-6.1.24-145767-Linux_amd64.run

Now run the installer:

$ sudo ./VirtualBox-6.1.24-145767-Linux_amd64.run

Install VirtualBox Extension pack

Virtualbox extension pack is a binary package that extends the functionality of VirtualBox. It provides extensions like USB support and host webcam pass-through. Its recommended that you install the VirtualBox extension pack, the same version as with your VirtualBox.

Download VirtualBox extension pack for the respective VirtualBox version using wget.

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

You can double click on that file to install the VirtualBox Extension Pack from the Desktop or can install using CLI.

Let's check how to install it from the CLI.

We will use vboxmanage command to install VirtualBox Extension pack as follows:

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

You will be prompted to accept Oracle's licensing terms when installing, type y and press enter:

 ...
 the prevailing party shall be entitled to its costs and attorneys'
 fees actually incurred in connection with such action or proceeding.
 Do you agree to these license terms and conditions (y/n)?

To enable the current user to run VirtualBox, add to the vboxusers group:

$ sudo usermod -aG vboxusers $(id -un)

Verify that user was added:

$ id -nG

Output:

linuxopsys sudo vboxusers

The will need to reboot your system to effect changes:

$ reboot

Verify successful installation by checking the version:

$ virtualbox -h

Output:

Oracle VM VirtualBox VM Selector v6.1.26
(C) 2005-2021 Oracle Corporation
All rights reserved.
No special options.
If you are looking for --startvm and related options, you need to use VirtualBoxVM.

You can now type the command virtualbox without argument and start creating virtual machines to host Guest operating systems.

Conclusion

In this tutorial, we learned how to install Virtualbox 6 on Debian 11. You now have a running VirtualBox on your Debian system.

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.

1 Comment

1 thought on “How to Install VirtualBox 6 on Debian 11 (3 methods)”

Leave a Comment