DebianDebian Based

How To Install VirtualBox on Debian 12

Install VirtualBox on Debian 12

In this tutorial, we will show you how to install VirtualBox on Debian 12. Virtualization technology has revolutionized the way we manage and deploy systems, allowing us to run multiple operating systems on a single physical machine. Among the plethora of virtualization software available, Oracle VirtualBox stands out as a versatile and powerful tool.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the VirtualBox on a Debian 12 (Bookworm).

Prerequisites

  • A server running one of the following operating systems: Debian 12 (Bookworm).
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies for VirtualBox.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install VirtualBox on Debian 12 Bookworm

Step 1. Before we install any software, it’s important to make sure your system is up to date by running the following apt commands in the terminal:

sudo apt update

This command will refresh the repository, allowing you to install the latest versions of software packages.

Step 2. Installing VirtualBox on Debian 12.

  • Method 1: Official VirtualBox Repository

First, add the VirtualBox repository to your system by running the following command:

sudo sh -c 'echo "deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian bullseye contrib" >> /etc/apt/sources.list.d/virtualbox.list'

Download and register the Oracle public key by running the following commands:

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 -

Update the package list by running the following command:

sudo apt update

Install VirtualBox by running the following command:

sudo apt install virtualbox-6.1

Once the installation is complete, you can launch VirtualBox from the applications menu or by running the following command:

virtualbox
  • Method 2: Manual Installation

Now download the latest version of VirtualBox for Debian from the official website at https://www.virtualbox.org/wiki/Linux_Downloads.

wget https://download.virtualbox.org/virtualbox/7.0.10/virtualbox-7.0_7.0.10-158379~Debian~bookworm_amd64.deb

Navigate to the directory where you downloaded the VirtualBox package by running the following command:

cd /path/to/download/directory

Install the required dependencies by running the following command:

sudo apt install build-essential dkms linux-headers-$(uname -r)

Install VirtualBox by running the following command:

sudo dpkg -i virtualbox-7.0_7.0.10-158379~Debian~bookworm_amd64.deb

Once the installation is complete, you can launch VirtualBox from the applications menu or by running the following command:

virtualbox

Install VirtualBox on Debian 12 Bookworm

Step 3. Troubleshooting and Tips.

Common Installation Issues √

  • Kernel Driver Not Installed (rc=-1908): Ensure you’ve started the VirtualBox service with sudo systemctl start vboxdrv.
  • VT-x/AMD-V Error: Enable hardware virtualization in your BIOS/UEFI settings.
  • USB Not Working in VM: Install the VirtualBox Extension Pack and enable the USB controller in VM settings.
  • No Internet in VM: Check your network settings in VirtualBox, and ensure your host system has Internet access.

Tips for Improving VM Performance √

  • Allocate an appropriate amount of CPU and RAM to your VM.
  • Use SSDs for your VM storage for better performance.
  • Enable 2D and 3D acceleration for improved graphical performance.
  • Keep your host OS and VirtualBox software updated.

Congratulations! You have successfully installed VirtualBox. Thanks for using this tutorial to install the latest version of the VirtualBox on Debian 12 Bookworm. For additional help or useful information, we recommend you check the official VirtualBox website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button