How to Install Virtualbox on Debian 12

Virtualbox is an emulator and useful to run multiple operating systems on a single computer. It is an open-source virtualization application that is used not only by enterprises but also for home use. 

Virtualbox allows the users to install the guest additions which add on the features including the copy-paste and drag-and-drop. It also supports USB and remote access to other machines with its remote desktop extensions. 

It can be installed on Windows and multiple Linux distributions including Debian. This post will explain the two different ways the installation of Virtualbox on Debian with its step-by-step guide. 

What are the Methods to Install Virtualbox on Debian Linux?

Virtualbox can be installed on Debian Linux by two different methods which are:

  1. Using the Debian Package List
  2. Downloading its Package from its Official Website

Method 1: Install Virtualbox on Debian Using the Debian Package List

The package list of the Debian Bookworm contains the installation package of Virtualbox which can be installed with the following steps. 

Step 1: Update the Package List

Update the package list of the Debian by running the below-mentioned command in the terminal:

$ sudo apt update

If there are some updates available, then install it by running the command:

$ sudo apt upgrade -y

Step 2: Add the Repository

First, import the fasttrack keyring with the following command:

$ sudo apt install fasttrack-archive-keyring

Then add the repository in the /etc/apt/sources.list file by opening it with the nano text editor:

deb http://fasttrack.debian.net/debian-fasttrack/ bookworm-fasttrack main contrib

deb http://fasttrack.debian.net/debian-fasttrack/ bookworm-backports-staging main contrib

Finally, update the package list again:

$ sudo apt update

Step 3: Find the Virtualbox Package

To display the information of the Virtualbox package available in the default repository of Debian, use the command:

$ sudo apt show virtualbox

Step 4: Install Virtualbox on Debian

The package of the Virtualbox in the previous step can be installed by running the command:

$ sudo apt install virtualbox -y

Also, the user can install the extension package of the “Virtualbox” with the following command:

$  sudo apt install virtualbox-ext-pack -y

The package of the Virtualbox has been installed successfully. 

Method 2: Install Virtualbox by Downloading its Debian Package from its Official Website

Another method to install the Virtualbox on Debian is by downloading its package from its official website with the next-mentioned steps. 

Step 1: Download the Package of Virtualbox

First, use the wget command to download the installation package of the VirtualBox on Debian using the terminal:

$ wget https://download.virtualbox.org/virtualbox/7.0.14/virtualbox-7.0_7.0.14-161095~Debian~bookworm_amd64.deb

Step 2: Confirm the Download 

The Debian package of the Virtualbox is downloaded and can be seen by listing down the contents of the directory with the following command:

$ ls

Step 3: Install Virtualbox

Now install the debian package of the Virtualbox with the dpkg package manager as shown:

$ sudo dpkg -i virtualbox-7.0_7.0.14-161095~Debian~bookworm_amd64.deb

Virtualbox has successfully installed Debian and can be used to run multiple operating systems by making their machines on it. 

How to Use the Virtualbox on Debian?

To use the VirtualBox, launch it by searching it from the application’s menu as shown:

Now click on the “New” button to create a new machine:

To find out the version details of the Virtualbox, click on “Help” and then “About Virtualbox” as shown in the below figure:

How to Uninstall the Virtualbox on Debian?

To uninstall and remove the package of the VirtualBox and its extension package along with its configuration files, run the command:

$  sudo apt purge virtualbox virtualbox-ext-pack -y

This is about the installation, usage, and uninstallation of the Virtualbox on Debian. 

Conclusion

To install the Virtualbox on Debian Linux, open the terminal and run the “sudo apt install virtualbox -y” command, also, it can be installed by downloading its debian package from its official website. 

Both installation methods of Virtualbox on Debian have been explained in the step-by-step guide.