Debian

How to Install Virtualbox On Debian 12

How to Install Virtualbox On Debian 12

VirtualBox is a powerful cross-platform tool that enables users to use and manage more than one operating system on their PCs concurrently. It has a user-friendly interface where users can create, manage, and run various OS i.e. Linux, Windows, or macOS, in a virtual environment without affecting the primary operating system.

While working on the Debian 12 system, if you want to experience and run different operating systems, you should install VirtualBox on your system. It will provide an isolated virtual environment to simultaneously run and use multiple operating systems.

This guide will illustrate the possible approaches for VirtualBox installation on Debian 12.

Quick Outline

How to Install VirtualBox on Debian 12?

On Debian 12 systems, VirtualBox can be installed from:

Prerequisite: Update the Debian System

Before jumping into the VirtualBox installation methods, make sure to update your Debian system first by executing the below-listed commands:

sudo apt update
sudo apt upgrade

Subsequently, Debian’s repository packages will be refreshed.

Method 1: Install VirtualBox on Debian 12 Via Deb Package File

The Oracle VirtualBox provides the Deb packages files of VirtualBox to install and set up on your system. You can get the latest version of VirtualBox on the Debian 12 systems using this method by following the provided instructions:

Step 1: Download the VirtualBox Deb Package File

First, download the VirtualBox’s latest Deb package file on your Debian 12 system via the “wget” command:

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

Note: Visit the official VirtualBox website to get the most recent version of the VirtualBox Deb file.

Alternatively, you can directly download the Deb file from the website by clicking on the below-highlighted link:

Step 2: Install VirtualBox on Debian 12

Then, install the VirtualBox on the Debian 12 system through its Deb file using the given command:

sudo apt install ./virtualbox-7.0_7.0.14-161095~Debian~bookworm_amd64.deb

Step 3: Verify VirtualBox Installation

Next, check the VirtualBox’s version to verify its installation on the system:

vboxmanage --version

The below output shows the installed version of VirtualBox on the system:

Method 2: Install VirtualBox on Debian 12 From the Official VirtualBox Repository

Another efficient way to install VirtualBox on Debian 12 is by adding the official VirtualBox repository to the system. This method installs the most up-to-date version of VirtualBox with the latest features and automatically updates it whenever a new version is released.

You can install VirtualBox on Debian 12 from the official VirtualBox repository by going through the provided steps:

Step 1: Import VirtualBox GPG Key

First, import the GPG key for VirtualBox via the given command to ensure its packages’ integrity on the Debian system:

curl -fSsL https://www.virtualbox.org/download/oracle_vbox_2016.asc | gpg --dearmor | sudo tee /usr/share/keyrings/virtualbox.gpg > /dev/null

Step 2: Add VirtualBox Repository

Next, write out the provided command to add/import the official VirtualBox repository to the Debian system:

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/virtualbox.gpg] http://download.virtualbox.org/virtualbox/debian bookworm contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list

Step 3: Refresh Debian 12

After that, you need to refresh your Debian 12 system to implement changes:

sudo apt update

Step 4: Install VirtualBox on Debian 12

Now, install the most up-to-date version of VirtualBox on Debian 12 by utilizing the following command:

sudo apt install virtualbox-7.0

Note: You can check the latest version offered by the VirtualBox repository using the “sudo apt search virtualbox” command. Currently, it is “virtualbox-7.0” that we are installing:

Step 5: Ensure Installation

To verify whether the VirtualBox’s latest version is installed or not, type out the given command to check its version:

vboxmanage --version

How to Enable and Start VirtualBox on Debian 12?

When the VirtualBox is installed on the system, its services start automatically by default. In case the VirtualBox services have not started on the Debian 12 system, you have to enable and start them manually.

Here are the steps:

Enable VirtualBox Services

First, enable the VirtualBox services to start automatically every time the system boots up, use the provided command:

sudo systemctl enable vboxdrv

Start VirtualBox Services

Then, execute the given command to start the VirtualBox service on the Debian 12 system:

sudo systemctl start vboxdrv

Check the Status of VirtualBox Services

To view the status of VirtualBox services on your Debian system, utilize the following command:

sudo systemctl status vboxdrv

How to Launch VirtualBox on Debian 12?

To start using VirtualBox on Debian 12, you have to launch it on your Debian system. You can launch VirtualBox either from the terminal or desktop environment (GUI).

Launch VirtualBox Via Terminal

You can launch VirtualBox through the terminal by executing the below-listed command:

virtualbox

Launch VirtualBox Via GUI

To launch VirtualBox via GUI, first, click on the “Activities” button on the screen’s top-left side. Then, type “VirtualBox” in the search box and open VirtualBox by clicking on it:

How to Install VirtualBox Extension Pack on Debian 12?

You can also install the relevant VirtualBox extension pack to enhance VirtualBox’s functionality on your Debian 12 system. These functionalities include Host webcam pass-through, Disk image encryption, USB 2.0/3.0 device support, VirtualBox Remote Desktop Protocol, and many more. Let’s learn how to install it:

Step 1: Download the Latest VirtualBox Extension Pack

First, download the relevant version of the VirtualBox extension pack on the Debian 12 system using the given command:

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

Note: Make sure you know the installed version of VirtualBox on your system to get its relevant extension pack. Here, we have the “7.0.14” version of VirtualBox on our system so we are downloading the extension pack of the same suitable version.

Alternatively, download/get it directly from the official website:

Step 2: Install VirtualBox Extension Pack

Then, utilize the following command to install the downloaded VirtualBox extension pack on your Debian 12 system:

sudo vboxmanage extpack install Oracle_VM_VirtualBox_Extension_Pack-7.0.14.vbox-extpack

Step 3: Verification

For the verification, you can display the relevant information of the installed VirtualBox extension pack on Debian 12 via the given command:

vboxmanage list extpacks

The below output shows the extension pack installed on the system:

How to Uninstall/Remove VirtualBox on Debian 12?

If you do not want to use VirtualBox on your Debian 12 system, you can simply uninstall or remove it from your system through the following command:

sudo apt remove virtualbox-7.0 -y

You should also remove the VirtualBox repository from your system as:

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

Also, remove the VirtualBox GPG key using the provided command:

sudo rm /usr/share/keyrings/virtualbox.gpg

To ensure that VirtualBox has been removed from Debian 12, type out the given command:

virtualbox

That was all about VirtualBox installation and uninstallation on Debian 12.

Conclusion

You can install VirtualBox on Debian 12 from the Deb package file or the VirtualBox’s official repository. Both methods provide the latest (most recent) version of VirtualBox for your Debian system. However, the official VirtualBox repository method is the most recommended approach as it automatically fetches and installs Virtualbox’s most up-to-date version from the official repository whenever new updates and features are available.

This article has covered two possible and efficient methods of VirtualBox installation on Debian 12.

Similar Posts