Install VirtualBox on Debian: Oracle APT Guide

Install VirtualBox on Debian: Oracle APT Guide

Choosing a package source can be confusing when Debian offers its own route and Oracle publishes another. VirtualBox runs virtual machines, and its host package can come from Oracle’s APT repository or Debian Fast Track.

I’ll explain how those package sources differ and walk through installing VirtualBox from Oracle’s repository on a supported release.

TL;DR: Install VirtualBox 7.2 on Debian or Ubuntu

Oracle’s APT repository currently offers VirtualBox 7.2.20 for supported Debian and Ubuntu releases on amd64, and the package name is virtualbox-7.2.

  • Use the distro codename that Oracle lists for your release.
  • Store Oracle’s key in a dedicated keyring and link it with signed-by.
  • Debian stable users can also choose Debian Fast Track instead of Oracle’s upstream repository.

What is the VirtualBox APT repository?

An APT repository is a package source that publishes indexes and downloadable software. Oracle’s source supplies signed package metadata that APT can use to find the package.

I checked Oracle’s current Linux download page and the package indexes for Trixie, Bookworm, Noble and Jammy. Each amd64 index listed virtualbox-7.2 version 7.2.20-175154 for its suite. The host running these read-only checks is arm64, so I did not install the amd64 package or claim a local installation test.

The command below reports the machine’s architecture and release codename. My run returned arm64 and noble, so this host does not verify the amd64 package installation path.

APT termWhat it selects
Repository URIOracle’s Debian package archive
Suite codenameThe distro index, such as trixie or noble
Componentcontrib, where Oracle publishes VirtualBox
signed-byThe key APT uses to verify this source

This is a host installation. Guest Additions are installed inside a virtual machine after an operating system is running there, so they are a separate task.

APT selects packages and dependencies from enabled indexes before dpkg unpacks them, as our guide to how APT and dpkg divide package work explains.

The repository entry contains four decisions: the package host, architecture filter, signing key and distribution suite. Keeping these values together makes future maintenance clearer because the source file shows which key and release the package manager is using.

How to install VirtualBox on Debian or Ubuntu

The commands below target amd64 and use Oracle’s dedicated keyring instead of the obsolete global apt-key workflow.

  • A supported amd64 Debian or Ubuntu release.
  • An administrator account that can run commands with sudo.
  • Internet access to Oracle’s download host.

Step 1: Check your architecture and release codename

First confirm the architecture and codename rather than guessing from a release number. Oracle’s current list includes Debian 13 Trixie, Debian 12 Bookworm, Debian 11 Bullseye, Ubuntu 24.04 Noble and Ubuntu 22.04 Jammy, among other listed releases.

The name shown in a desktop’s About panel may be a marketing release number rather than the codename APT expects. The os-release file supplies that codename directly. Compare it with Oracle’s list before changing package sources, particularly after a major distribution upgrade.

dpkg --print-architecture
. /etc/os-release && printf '%s\n' "$VERSION_CODENAME"

Compare both outputs with Oracle’s package index, which is tied to one architecture and one distribution suite.

arm64
noble
Terminal output showing arm64 architecture and noble codename

Oracle’s indexed packages require amd64, and the source suite must match the release codename without a substitution.

Step 2: Create a keyring for Oracle’s signing key

wget -qO- https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --dearmor --yes -o /usr/share/keyrings/oracle-virtualbox-2016.gpg

This command writes Oracle’s dearmored key to the dedicated keyring. Step 3 refers to this path with signed-by, unlike the deprecated global apt-key workflow.

Step 3: Add Oracle’s repository for your codename

Now add a source entry that binds the Oracle archive to the keyring. Replace CODENAME with the value from Step 1, such as trixie, bookworm, noble or jammy.

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

If your suite is unavailable, stop and choose a package source documented for that distribution.

Step 4: Refresh package indexes and install VirtualBox

APT must read the new source before it can find the package. Refresh the indexes, then request the currently published 7.2 series.

sudo apt update
sudo apt install virtualbox-7.2

Read the proposed package transaction before confirming it. The package version can advance within the 7.2 series as Oracle publishes updates, while the series name remains virtualbox-7.2.

If APT cannot find the package after the index refresh, inspect the output from apt update before repeating the install command. A 404 for the suite can mean the codename is wrong or no longer published.

Signature warnings point to the key or source entry. Network and dependency errors need their own fixes, so read APT’s transaction before accepting it.

Step 5: Confirm the installed version

Use VirtualBox’s management command to check the installed build. It prints the version without changing packages.

vboxmanage -v

The command prints the installed VirtualBox release number, which can include a revision suffix.

What to check after installation

VirtualBox’s vboxdrv kernel module connects each virtual machine to the running host kernel.

CaseWhat to checkNext step
Kernel driver not loadedvboxdrv module statusCheck the VirtualBox service/module setup for your distribution and running kernel
Module build failedHeaders matching uname -r and compiler/build toolsInstall matching headers and DKMS through your distro package manager, then follow the package’s module setup instructions
Secure Boot blocks the moduleKernel log or module-signing promptFollow your distribution’s documented module-signing enrollment process
USB features unavailableExtension Pack installation and vboxusers membershipCheck the Extension Pack license and access requirements

When a kernel update requires a new external module build, DKMS can automate it if matching headers and build tools are present, but Secure Boot still checks the module signature.

Investigate the host’s module build and kernel log. Headers installed inside a virtual machine belong to its kernel and cannot build the host’s vboxdrv module.

Secure Boot can reject a third-party kernel module unless the boot chain trusts its signature. Since signing and enrollment differ by distribution and may require a reboot, use the instructions for your exact release.

Separate host-driver failures from guest boot problems before making another package change. A VM can fail because its virtual disk or boot order is wrong even when vboxdrv loads correctly. Conversely, a driver error appears before the guest operating system starts, so reinstalling Guest Additions inside that guest cannot fix the host module.

Keep the first useful error from the module build log. Later messages often report only that the module is missing, while the earlier entry names a compiler mismatch, missing header or signing issue. Match the remedy to that first cause and consult your distribution’s VirtualBox package notes before repeating the Oracle build steps.

  • Read the module build log for the first error, not just the final driver warning.
  • Check headers against the running kernel with uname -r.
  • Complete the documented module-signing step if Secure Boot rejects the module.

The base application runs virtual machines without the Extension Pack. For USB 2.0/3.0 or remote display, match the add-on version to the installed VirtualBox release. The add-on has separate license terms from the GPL-licensed base package.

Oracle’s download page publishes the current base release and Extension Pack together. The Extension Pack license permits personal and educational use under its terms, while commercial or enterprise use requires the applicable commercial terms. Check the license that applies to your use before installing it.

For USB passthrough, check that your account belongs to vboxusers and start a new login session after changing group membership so the session receives the updated groups.

For the next task, follow our guide to install Ubuntu as a VirtualBox guest. A guest boot error has separate checks in our no-bootable-medium troubleshooting guide.

Which VirtualBox package source should Debian users choose?

Use one package source for VirtualBox rather than mixing repositories.

  • Debian Fast Track: a Debian-maintained rolling package route for stable releases, with its own backports and keyring setup.
  • Oracle APT repository: Oracle’s upstream package route, outside Debian’s support boundary.

Debian’s VirtualBox wiki describes Fast Track for stable releases. Follow its current setup instructions before adding that source.

For Oracle APT key setup on another product, see our guide to adding Oracle’s APT repository for MySQL. The key and repository details differ by product.

After setup, APT can manage updates from the configured source. If you later remove a source, first decide whether you only want to stop future package lookups or also change installed packages. Our guide explains how to remove an APT repository in Ubuntu, and this comparison explains how APT and dpkg divide package work.

Keep one source of VirtualBox packages active unless you have a deliberate package-management plan. If both Debian Fast Track and Oracle’s repository offer packages with overlapping names, APT’s candidate selection and package dependencies can complicate later upgrades or removal.

Conclusion: Keep the repository tied to your distro

Check the repository configuration and host kernel module when diagnosing an install that does not start virtual machines. Recheck Oracle’s support list before adding a newly released distribution. Keep the source file available for future maintenance.

FAQ

These quick answers cover the release, package-source and add-on questions that often follow an installation.

How do I install VirtualBox on Debian 13?

On amd64 Debian 13 Trixie, add Oracle’s signing key to a dedicated keyring, add the Oracle APT source with suite trixie and signed-by, run sudo apt update, then install virtualbox-7.2. Debian Fast Track is a separate Debian-maintained option.

Which Ubuntu versions does the Oracle repository support?

Oracle’s current Linux Downloads page lists Ubuntu 26.04, 25.10, 25.04, 24.04 and 22.04. Use only a codename listed on that page and confirm the package index for your architecture.

Does VirtualBox need the Extension Pack?

No. The base package runs VirtualBox. The separate Extension Pack adds features such as USB 2.0/3.0 and remote display, requires a matching version, and has its own license terms.

Are Guest Additions the same as the VirtualBox host package?

No. The host package runs on Debian or Ubuntu. Guest Additions are installed inside a guest operating system to add guest integration features.