How to Install VirtualBox on Debian 13, 12 and 11

Last updated Tuesday, May 19, 2026 9:43 am Joshua James 8 min read

VirtualBox on Debian needs more than the desktop package: the Oracle repository, matching kernel headers, and the VirtualBox kernel modules all have to line up before a VM can start. The Oracle APT repository currently publishes virtualbox-7.2 for Debian 13 (Trixie), Debian 12 (Bookworm), and Debian 11 (Bullseye) on amd64, with virtualbox-7.1 still available as a compatibility branch. A reliable setup installs VirtualBox from Oracle’s repository, verifies the kernel modules, and adds the optional Extension Pack when you need USB 2.0/3.0, disk encryption, or VRDP support.

VirtualBox is the right fit when you need full guest operating systems. For Linux desktop applications that only need a sandboxed app runtime, install Flatpak on Debian instead of creating full virtual machines.

Install VirtualBox on Debian

Use the manual DEB822 source method for new installs unless you intentionally manage third-party repositories with extrepo. Both paths point APT at Oracle’s VirtualBox repository, so configure only one source path before installing the package.

Choose a VirtualBox Installation Method

MethodSource or ChannelUpdate BehaviorBest ForTrade-offs
Manual DEB822 sourceOracle VirtualBox APT repositoryAPT-managed updates from OracleNew installs, auditable setup, scripted deployments, and explicit source cleanupRequires a few more commands, but the keyring and source file are visible
extrepoDebian extrepo data for Oracle’s VirtualBox repositoryAPT-managed updates from OracleExisting extrepo-managed systems or readers who already use extrepo for third-party sourcesDepends on the extrepo package data and key copy being current for your Debian release

Use only one repository setup method. Configuring both extrepo and a manual source for the same Oracle repository can create duplicate-source or Signed-By conflicts in APT.

The manual DEB822 method is the cleaner default because it uses Oracle’s current signing key directly and creates one obvious source file. Use extrepo only when that helper is already part of your repository workflow; the broader extrepo workflow is covered in the Debian extrepo repository management guide.

Prepare Debian Before Installing VirtualBox

Refresh APT before adding or installing VirtualBox packages:

sudo apt update

These commands use sudo for package, repository, and kernel-module tasks. If your account does not have administrator access yet, configure it first with the Debian sudoers setup guide.

If Debian recently installed a kernel update, reboot before installing VirtualBox so uname -r reports the kernel you are actually using. VirtualBox builds modules for the running kernel, and stale boot state is a common cause of missing-driver errors.

uname -r

Install VirtualBox with a Manual DEB822 Source

Install the tools needed to download and dearmor the Oracle signing key:

sudo apt install ca-certificates curl gpg

Download Oracle’s VirtualBox archive signing key and store it as a binary keyring used only by this source:

curl -fsSL https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --dearmor --yes -o /usr/share/keyrings/virtualbox.gpg

Verify the saved key fingerprint before writing the source file:

gpg --show-keys --with-fingerprint /usr/share/keyrings/virtualbox.gpg
pub   rsa4096 2016-04-22 [SC]
      B9F8 D658 297A F3EF C18D  5CDF A2F6 83C5 2980 AECF
uid           Oracle Corporation (VirtualBox archive signing key) <info@virtualbox.org>

Create the Oracle source only when the system is an amd64 Debian release that Oracle publishes packages for. The guard prevents APT source drift on arm64 systems or unsupported codenames:

. /etc/os-release
arch=$(dpkg --print-architecture)

case "${VERSION_CODENAME}:${arch}" in
  trixie:amd64|bookworm:amd64|bullseye:amd64)
    printf '%s\n' \
      'Types: deb' \
      'URIs: https://download.virtualbox.org/virtualbox/debian' \
      "Suites: ${VERSION_CODENAME}" \
      'Components: contrib' \
      'Architectures: amd64' \
      'Signed-By: /usr/share/keyrings/virtualbox.gpg' | sudo tee /etc/apt/sources.list.d/virtualbox.sources > /dev/null
    ;;
  *)
    printf 'Oracle publishes VirtualBox packages for Debian trixie, bookworm, and bullseye on amd64, not %s on %s.\n' "${VERSION_CODENAME:-unknown}" "$arch" >&2
    ;;
esac

If the unsupported-release message prints, stop before installing the package. On supported amd64 systems, refresh APT and confirm the Oracle candidate appears:

sudo apt update
apt-cache policy virtualbox-7.2

The package version and codename should match your Debian release. This example is from Debian 13 (Trixie):

virtualbox-7.2:
  Installed: (none)
  Candidate: 7.2.8-173730~Debian~trixie
  Version table:
     7.2.8-173730~Debian~trixie 500
        500 https://download.virtualbox.org/virtualbox/debian trixie/contrib amd64 Packages

Install VirtualBox with extrepo

Use extrepo only if you deliberately prefer Debian’s repository helper or already manage third-party sources that way. Skip this section if you created the manual virtualbox.sources file.

sudo apt install extrepo

VirtualBox is in Oracle’s contrib component, so allow contrib repositories in the extrepo configuration before enabling VirtualBox:

sudo sed -i 's/# - contrib/- contrib/' /etc/extrepo/config.yaml
sudo extrepo enable virtualbox
sudo apt update

Confirm APT now sees Oracle’s VirtualBox package for your Debian codename:

apt-cache policy virtualbox-7.2

The candidate should come from download.virtualbox.org for your Debian codename. If the candidate is empty, rerun sudo apt update, inspect /etc/apt/sources.list.d/extrepo_virtualbox.sources, and switch to the manual DEB822 method if the extrepo catalog is stale.

Install the VirtualBox Package and Kernel Headers

Install VirtualBox 7.2 with the compiler tools and headers needed to build host modules. The linux-headers-amd64 metapackage keeps future stock Debian amd64 kernel headers available, while linux-headers-$(uname -r) covers the kernel currently booted.

sudo apt install virtualbox-7.2 linux-headers-$(uname -r) linux-headers-amd64 build-essential perl

If you use a custom, Liquorix, XanMod, or other non-Debian kernel, install the matching headers from that kernel source instead of assuming linux-headers-amd64 matches your booted kernel.

Oracle’s package also exposes virtualbox-7.1 in the same repository. Use virtualbox-7.1 only when a VM workflow or Extension Pack requirement keeps you on that branch, and keep the package name consistent in update and removal commands.

Verify VirtualBox and Kernel Modules

Check the installed VirtualBox version first:

VBoxManage -v
7.2.8r173730

Then check the kernel-module service script installed by Oracle’s package:

sudo /usr/lib/virtualbox/vboxdrv.sh status
VirtualBox kernel modules (vboxdrv, vboxnetflt, vboxnetadp) are loaded.

The loaded module list should include vboxdrv and the networking modules:

lsmod | grep -E '^vbox(drv|netflt|netadp)'
vboxnetadp             28672  0
vboxnetflt             40960  0
vboxdrv               704512  2 vboxnetadp,vboxnetflt

If the install transaction also brought in a newer Debian kernel, reboot, then rebuild the modules for the kernel now shown by uname -r:

sudo reboot

After the system returns, run the module rebuild command and repeat the status check:

sudo /sbin/vboxconfig
sudo /usr/lib/virtualbox/vboxdrv.sh status

Launch VirtualBox on Debian

VirtualBox can start from the desktop launcher or from a terminal in a graphical session. The package installs the command names virtualbox, VBoxManage, and related tools under the Oracle package layout.

Launch VirtualBox from the Terminal

Start the VirtualBox Manager from a desktop terminal:

virtualbox

Launch VirtualBox from the Applications Menu

Open the applications menu, search for VirtualBox, and start Oracle VirtualBox. On GNOME, open Activities and search for VirtualBox. The first launch should show the VirtualBox Manager window where you can create or import virtual machines.

Install the VirtualBox Extension Pack

The Extension Pack is optional. It adds host-side features such as USB 2.0/3.0 passthrough, VirtualBox Remote Desktop Protocol, disk encryption, NVMe support, and PXE ROM support. The Extension Pack version must match the installed VirtualBox version exactly.

Oracle licenses the Extension Pack under the Personal Use and Evaluation License (PUEL). Personal, educational, and evaluation use can be free, while commercial use can require a paid license. Review the VirtualBox PUEL license terms before deploying it on business systems.

Download and Verify the Extension Pack

Resolve the installed VirtualBox version from VBoxManage:

VBOX_VERSION=$(VBoxManage -v | cut -d r -f 1)
printf 'VirtualBox version: %s\n' "$VBOX_VERSION"
VirtualBox version: 7.2.8

Download the matching Extension Pack and Oracle’s checksum file from the same version directory:

curl -fLO "https://download.virtualbox.org/virtualbox/${VBOX_VERSION}/Oracle_VirtualBox_Extension_Pack-${VBOX_VERSION}.vbox-extpack"
curl -fLO "https://download.virtualbox.org/virtualbox/${VBOX_VERSION}/SHA256SUMS"

Verify the downloaded file against the checksum entry for the exact non-revisioned Extension Pack filename:

grep -F "Oracle_VirtualBox_Extension_Pack-${VBOX_VERSION}.vbox-extpack" SHA256SUMS | sha256sum -c -
Oracle_VirtualBox_Extension_Pack-7.2.8.vbox-extpack: OK

Install and Verify the Extension Pack

Install the Extension Pack with VBoxManage. The command opens Oracle’s license prompt in the terminal; type y only if you accept the license terms.

sudo VBoxManage extpack install --replace "Oracle_VirtualBox_Extension_Pack-${VBOX_VERSION}.vbox-extpack"

Confirm the Extension Pack is installed and usable:

VBoxManage list extpacks
Extension Packs: 1
Pack no. 0:   Oracle VirtualBox Extension Pack
Version:      7.2.8
Usable:       true

Add Your User to vboxusers

USB passthrough requires membership in the vboxusers group. Add your current user while preserving all existing group memberships:

sudo usermod -aG vboxusers "$USER"

Log out and back in so the desktop session receives the new group. Then verify the group membership:

groups "$USER" | grep -w vboxusers
username : username sudo vboxusers

Install Guest Additions in Virtual Machines

Guest Additions are installed inside each guest VM, not on the Debian host. They improve display resizing, pointer integration, clipboard sharing, time synchronization, and shared folders. Oracle’s Debian package includes the Guest Additions ISO at /usr/share/virtualbox/VBoxGuestAdditions.iso, and the VirtualBox menu can attach it to a running VM.

Install Guest Additions on Linux Guests

Inside a Debian or Ubuntu guest, install build tools and headers for the guest’s running kernel:

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

For Fedora or RHEL-family guests, install the matching development packages inside that guest instead:

sudo dnf install kernel-devel kernel-headers gcc make perl bzip2

In the VirtualBox VM window, select Devices > Insert Guest Additions CD image. If the guest does not mount the CD automatically, mount it manually:

sudo mkdir -p /mnt/cdrom
sudo mount /dev/cdrom /mnt/cdrom

Run the Linux Guest Additions installer from the mounted ISO, then reboot the guest:

sudo sh /mnt/cdrom/VBoxLinuxAdditions.run
sudo reboot

After the guest reboots, Oracle’s helper can check the Guest Additions kernel and user services:

sudo rcvboxadd status-kernel
sudo rcvboxadd status-user

Install Guest Additions on Windows Guests

For Windows guests, select Devices > Insert Guest Additions CD image while the VM is running. Open the CD drive in File Explorer, run VBoxWindowsAdditions.exe, accept the driver prompts, and reboot Windows when the installer finishes.

Enable Shared Folders for Linux Guests

After Guest Additions are installed, shut down the VM and configure a share under Settings > Shared Folders. Inside a Linux guest, add the guest user to vboxsf so shared folders under /media/sf_<share-name> are accessible without root:

sudo usermod -aG vboxsf "$USER"

Log out and back in inside the guest before testing the shared folder.

Troubleshoot VirtualBox on Debian

Fix Kernel Driver Not Installed rc=-1908

The Kernel driver not installed (rc=-1908) or VERR_VM_DRIVER_NOT_INSTALLED error means the host modules are missing, unloaded, or blocked. Start by installing headers for the running kernel and rebuilding the modules:

sudo apt install linux-headers-$(uname -r) build-essential perl
sudo /sbin/vboxconfig
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.

Load vboxdrv and recheck the module state:

sudo modprobe vboxdrv
sudo /usr/lib/virtualbox/vboxdrv.sh status

Match Headers After a Kernel Update

If Debian boots into a newer kernel after installing VirtualBox, the module state can be different from the pre-reboot check. Compare the running kernel to the installed header package and rebuild the modules:

uname -r
dpkg -l "linux-headers-$(uname -r)"
sudo /sbin/vboxconfig

If the header package is missing, install it and rerun vboxconfig. For broader kernel maintenance, use the Debian kernel installation guide before changing kernel branches.

Handle Secure Boot Module Blocking

Secure Boot can prevent unsigned VirtualBox modules from loading. Install mokutil if needed and check the firmware state:

sudo apt install mokutil
mokutil --sb-state

If Secure Boot is enabled and vboxconfig reports that the modules must be signed, either disable Secure Boot in firmware or use a deliberate module-signing workflow for your system. Do not ignore the failure; the VM may open in VirtualBox Manager but fail when it tries to start.

Fix Missing USB Devices in Guests

USB 2.0/3.0 passthrough needs both the Extension Pack and host user membership in vboxusers. Check both before changing VM USB controller settings:

VBoxManage list extpacks
groups "$USER" | grep -w vboxusers

If the group check has no output, add your user to vboxusers, log out, and log back in. If the Extension Pack is missing or marked unusable, reinstall the exact version that matches VBoxManage -v.

Manage VirtualBox on Debian

Update VirtualBox

Oracle repository packages update through APT. The examples use the virtualbox-7.2 branch; replace the package name with virtualbox-7.1 if you deliberately installed that compatibility branch.

sudo apt update
sudo apt install --only-upgrade virtualbox-7.2

When VirtualBox moves to a new version, download and install the matching Extension Pack again. A mismatched Extension Pack can appear installed but unusable.

Remove VirtualBox

If the Extension Pack is installed, remove it before removing the base package:

VBoxManage list extpacks
sudo VBoxManage extpack uninstall "Oracle VirtualBox Extension Pack"

Remove the VirtualBox package and review dependency cleanup. Replace virtualbox-7.2 with virtualbox-7.1 if that is the installed branch:

sudo apt purge virtualbox-7.2
sudo apt autoremove

If you used extrepo, disable the VirtualBox source and refresh APT:

sudo extrepo disable virtualbox
sudo rm -f /etc/apt/sources.list.d/extrepo_virtualbox.sources
sudo rm -f /var/lib/extrepo/keys/virtualbox.asc
sudo apt update

If you used the manual DEB822 method, remove the source file and keyring, then refresh APT:

sudo rm -f /etc/apt/sources.list.d/virtualbox.sources
sudo rm -f /usr/share/keyrings/virtualbox.gpg
sudo apt update

Confirm the Oracle source no longer provides a candidate:

apt-cache policy virtualbox-7.2
virtualbox-7.2:
  Installed: (none)
  Candidate: (none)
  Version table:

The next cleanup removes local VM definitions and virtual disk images for your user account. Back up any VM you still need before deleting ~/VirtualBox VMs/.

Review your local VM directory before deleting it:

[ -d "$HOME/VirtualBox VMs" ] && find "$HOME/VirtualBox VMs" -maxdepth 1 -mindepth 1 -print

Delete the directory only when you no longer need the VM files:

rm -rf "$HOME/VirtualBox VMs"

Conclusion

VirtualBox is installed from Oracle’s Debian repository with the host modules, package source, and optional Extension Pack checks in place. Create a test VM, confirm Guest Additions inside the guest, and rerun sudo /sbin/vboxconfig after future kernel changes if VirtualBox reports a missing host driver.

Follow LinuxCapable

Want more LinuxCapable guides in Google?

Add LinuxCapable as a preferred source so Google can show more of our fresh Linux tutorials in Top Stories and From your sources when relevant.

Add LinuxCapable as a preferred source on Google
Search LinuxCapable

Need another guide?

Search LinuxCapable for package installs, commands, troubleshooting, and follow-up guides related to what you just read.

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffeeBuy me a coffee
Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed in published comments:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<blockquote>quote</blockquote> quote block

Got a Question or Feedback?

We read and reply to every comment - let us know how we can help or improve this guide.

Let us know you are human: