How to Install VirtualBox on Debian 12 Step-by-Step

In this guide, we’ll explore how to install VirtualBox on Debian 12 providing you with the power to create and run virtual machines on your system. Whether you’re a developer, IT enthusiast, or simply curious about virtualization technology, this step-by-step guide will help you get started with VirtualBox on your Debian 12 machine.

VirtualBox is a free and open-source virtualization software used at desktop level. It is available for both Linux and Windows operating system. VirtualBox allows to spin up multiple virtual machines of different operating systems. It is used to setup test environment on laptop or desktop by creating virtual machines.

Prerequisites

  • Pre-Installed Debian 12
  • User with sudo rights
  • Internet connectivity

Without any further delay, let’s deep dive into VirtualBox installation steps.

1) Add VirtualBox APT Repository

VirtualBox package is not included in the default package repositories, so we to have add its official repository.

Login to your Debian 12 system and open the terminal and run the following commands to import gpg key of Virtualbox repository.

$ sudo apt install curl wget gnupg2 lsb-release -y
$ curl -fsSL https://www.virtualbox.org/download/oracle_vbox_2016.asc|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/vbox.gpg
$ curl -fsSL https://www.virtualbox.org/download/oracle_vbox.asc|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/oracle_vbox.gpg

Now, run beneath echo command to add virtualbox repository on Debian 12

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

2) Install VirtualBox on Debian 12

Run the following apt command to install latest virtualbox 7.

$ sudo apt update
$ sudo apt install linux-headers-$(uname -r) dkms -y
$ sudo apt install virtualbox-7.0 -y

Install-VirtualBox-Debian12-Apt-Command

3) Add Your User to the vboxusers Group

To use VirtualBox without superuser privileges, you need to add your user to the vboxusers group. Run below usermod command.

$ sudo usermod -aG vboxusers $USER
$ newgrp vboxusers

Next, try to start Virtualbox in the following step.

4) Start VirtualBox

Search virtualbox from Activity as shown below,

Start-VirtualBox-Debian12

Click on VirtualBox Icon

VirtualBox-GUI-Debian12

Perfect, above confirms that virtualbox has been launched successfully. To add some additional features to virtualbox then install it’s extension pack.

5) Install VirtualBox Extension Pack

Virtualbox extension pack will add following features to your virtualbox :

  • Support for USB 2.0/3.0
  • VirtualBox RDP
  • Disk encryption
  • NVMe and PXE boot for Intel cards

For its installation first download the pack file using following wget command.

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

Once the file is downloaded then run below vboxmanage command for its installation.

$ sudo vboxmanage extpack install Oracle_VM_VirtualBox_Extension_Pack-7.0.10.vbox-extpack

It will prompt you to accept license terms and conditions. Press ‘y‘ to accept and finish installation

Accept-VirtualBox-Extension-Pack-License-Debian12

Above output confirms that extension pack installation is successful. In order to validate extension pack installation, head back to virtualbox gui,

Go to File –> Tools –> Extension Pack Manager

Check-VirtualBox-Extension-Pack-Debian12

That’s all from this guide, you have successfully installed VirtualBox on your Debian 12 system!

Conclusion

VirtualBox is a powerful virtualization tool that can be a game-changer for developers, system administrators, and enthusiasts. By following this step-by-step guide, you’ve learned how to install VirtualBox on Debian 12, enabling you to run multiple operating systems on your Debian machine with ease. Whether you’re testing software or exploring new environments, VirtualBox provides a flexible and user-friendly solution for all your virtualization needs.

7 thoughts on “How to Install VirtualBox on Debian 12 Step-by-Step”

  1. Priceless mini-tutorial
    Forever grateful

    Just one thing.. when I opened up Vbox after installation, I got a warning informing me that I wouldn’t be able to create a VM as the vbox kernel module wasnt loaded (?)
    I solved this problem doing this:

    1) sudo apt-get install linux-headers-4.9.0-4-686-pae

    2) sudo /sbin/vboxconfig

    After that was done, Vbox was working nicely

    Reply
    • Hi Alexander,

      Complete command is: sudo apt-add-repository 'deb http://download.virtualbox.org/virtualbox/debian stretch contrib'

      Reply

Leave a Reply to Pradeep Kumar Cancel reply