Debian

How to Install VirtualBox 7 on Debian 12

VirtualBox is a cross-platform (available on Windows, Linux, and macOS) and open-source virtualization software developed by Oracle. It is used to create and run multiple virtual machines (VMs) on a single physical computer. You can install an operating system (any Linux distribution, Windows, macOS, and any BSD distribution, etc.) of your choice in those virtual machines and try out any software on them in an isolated environment. This gives you the ability to test out new things without affecting/damaging the physical computer. You can also create a software development environment on the virtual machines and run your favorite development tools to make your work more efficient.

In this article, we will show you how to install VirtualBox 7 on Debian 12 “Bookworm”.

Topic of Contents:

  1. Enable the Hardware Virtualization on Your Computer
  2. Installing the GCC and Linux Kernel Headers to Build the VirtualBox Kernel Modules
  3. Downloading the Latest Version of Oracle VirtualBox for Debian 12
  4. Downloading the VirtualBox Extension Pack
  5. Updating the Debian 12 APT Package Database Cache
  6. Installing VirtualBox 7 on Debian 12
  7. Running VirtualBox on Debian 12
  8. Installing the VirtualBox Extension Pack on VirtualBox
  9. Conclusion

Enable the Hardware Virtualization on Your Computer

For VirtualBox virtual machines to perform well, you must enable the hardware virtualization on your computer from the BIOS/UEFI Firmware of the motherboard. How you enable it on your motherboard depends on the vendor of the motherboard that you’re using on your computer.

If you need any assistance in enabling the hardware virtualization from the BIOS/UEFI Firmware of your computer, read the article on How to Enable the VT-x/VT-d/AMD-v Hardware Virtualization Feature from the BIOS/UEFI Firmware of Your Motherboard.

Installing the GCC and Linux Kernel Headers to Build the VirtualBox Kernel Modules

To compile the VirtualBox kernel modules on Debian 12, you must have the GCC C/C++ compiler and Linux kernel headers installed on your Debian 12 system.

If you need any assistance in installing the GCC C/C++ compiler on your Debian 12 system, read the article on How to Install the GCC C/C++ Compiler on Debian 12.

If you need any assistance in installing the correct Linux kernel headers on your Debian 12 system, read the article on How to Install the Linux Kernel Headers on Debian 12.

Downloading the Latest Version of Oracle VirtualBox for Debian 12

To download the latest version of Oracle VirtualBox for Debian 12, visit the VirtualBox Downloads page from your favorite web browser.

Once the page loads, click on “Debian 12” as marked in the following screenshot:


Your browser should start downloading the VirtualBox DEB package file. It takes a while to complete.


At this point, the VirtualBox DEB package file should be downloaded.

Downloading the VirtualBox Extension Pack

The VirtualBox Extension Pack adds a lot of advanced features to VirtualBox. These features will make your VirtualBox experience a lot better.

To download the VirtualBox Extension Pack, visit the “Downloads” page of VirtualBox.

Once the page loads, scroll down to the “VirtualBox Oracle VM VirtualBox Extension Pack” section and click on “All supported platforms”.

NOTE: Make sure to download the same version of the VirtualBox Extension Pack as the version of the VirtualBox that you’re downloading. Since you are downloading the VirtualBox and VirtualBox Extension Pack at the same time, the version number will most likely match.


Your browser should start downloading the VirtualBox Extension Pack file. It takes a few seconds to complete.


At this point, the VirtualBox Extension Pack file should be downloaded.

Updating the Debian 12 APT Package Database Cache

Before you install VirtualBox using the VirtualBox DEB package file that you just downloaded, update the Debian 12 APT package database cache with the following command:

$ sudo apt update

 

Installing VirtualBox 7 on Debian 12

The VirtualBox DEB package file should be downloaded in the ~/Downloads directory of your Debian 12 machine.

$ cd ~/Downloads
$ ls -lh

 

To install VirtualBox using the VirtualBox DEB package file, run the following command:

$ sudo apt install ./virtualbox-7.0_7.0.10-158379~Debian~bookworm_amd64.deb

 
To confirm the installation, press Y and then press <Enter>.


The VirtualBox DEB package file and the required dependency packages are being downloaded. It takes a while to complete.


The VirtualBox DEB package file and the required dependency packages are being installed. It takes a while to complete.


At this point, VirtualBox should be installed on your Debian 12 system.

Running the VirtualBox on Debian 12

Once VirtualBox is installed, you will find the VirtualBox in the “Application Menu” of Debian 12.

To run the VirtualBox, click on the VirtualBox icon.


VirtualBox should be opened. You can create and manage the virtual machines from here.

Installing the VirtualBox Extension Pack on VirtualBox

Once you installed VirtualBox on your Debian 12 system, it is highly recommended that you install the VirtualBox Extension Pack.

To install the VirtualBox Extension Pack, open VirtualBox and click on  > Extensions as marked in the following screenshot:


Click on “Install”.


Select the VirtualBox Extension Pack file that you just downloaded and click on “Open”.


Click on “Install”.


You will see the VirtualBox License. Scroll all the way down and click on “I Agree”.


Type in your Debian 12 login password and click on “Authenticate”.


The VirtualBox Extension Pack should be installed.

Conclusion

We showed you how to download the VirtualBox DEB package file for Debian 12. We also showed you how to download the VirtualBox Extension Pack file for VirtualBox and how to install VirtualBox on Debian 12 as well as we run it on Debian 12. Finally, we showed you how to install the VirtualBox Extension Pack on VirtualBox.

About the author

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.