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.
In this tutorial, we learn how to install VirtualBox 6 on Debian 11.
Method 1: Install VirtualBox from Oracle Repository
This is the easiest way to install VirtualBox on Debian, from the Oracle repository.
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 -
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
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.
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:
Method 2: Install VirtualBox on Debian Using Installer Script
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 script.
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
linoxide sudo vboxusers
The will need to reboot your system to effect changes:
Verify successful installation by checking the version:
$ virtualbox -h
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.
In this tutorial, we learned how to install Virtualbox 6 on Debian 11. You now have a running VirtualBox on your Debian system.