How to Install VirtualBox on Linux Mint 22 and 21

Install VirtualBox on Linux Mint 22.x and 21.x using Mint packages or Oracle APT. Covers Extension Pack, updates, removal.

Last updatedAuthorJoshua JamesRead time9 minGuide typeLinux MintDiscussion6 comments

Choosing how to install VirtualBox on Linux Mint matters because Mint’s repository and Oracle’s repository land on different branches. If you came here looking for a VirtualBox download, a managed APT install is cleaner than chasing a one-off .deb file.

Mint 22.x, including 22.3 and 22.2, and Mint 21.x work with either method. Mint’s package keeps setup simple; Oracle’s repository moves you to the current 7.2 branch while keeping updates inside APT.

Install VirtualBox on Linux Mint

Both installation paths work on supported Mint releases, but they land on different VirtualBox branches. The Linux Mint package is the better default when you want the least maintenance, while Oracle’s repository is the better fit when you specifically want Oracle’s newer upstream build.

MethodLinux Mint 22.xLinux Mint 21.xBest For
Linux Mint repositories7.0.16.x6.1.50.xSimplest setup, no extra repository to maintain
Oracle repository7.2.x7.2.xNewer upstream branch and Oracle’s current package stream

These methods apply to the standard 64-bit x86 Linux Mint desktop editions. Oracle’s Linux host packages are published as amd64 builds for the Ubuntu bases Mint uses here; LMDE follows Debian sources and needs Debian-specific package instructions.

Oracle also publishes direct Ubuntu .deb downloads on the VirtualBox Linux downloads page, but the repository path is easier to maintain on Linux Mint because updates stay in your normal APT workflow.

Install VirtualBox from Linux Mint repositories

This method stays inside the repositories Linux Mint already uses, so it is the simplest option for most desktop systems.

Refresh APT before installing VirtualBox

Refresh package metadata before installing. Apply routine system updates separately if APT reports them, especially after a recent kernel update, then reboot into the updated kernel before building VirtualBox modules.

sudo apt update

These commands use sudo for system changes. If your account is not allowed to run administrative commands yet, follow the guide on how to create and add users to sudoers on Linux Mint before continuing.

Install the Linux Mint VirtualBox package on Linux Mint

Mint 22.x currently installs the 7.0.16 series, while Mint 21.x installs the older 6.1.50 series. Install matching kernel headers at the same time so the VirtualBox modules build against the kernel you are running right now.

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

The $(uname -r) expansion inserts your running kernel version so APT pulls the matching headers instead of a generic package.

Verify the Linux Mint VirtualBox package on Linux Mint

The distro-packaged method does not create vboxdrv.service on Mint 22.x or 21.x, so verify the installed package revision and loaded modules directly.

dpkg-query -W virtualbox

Expected output on Mint 22.x looks like this:

virtualbox      7.0.16-dfsg-2ubuntu1.3

Mint 21.x reports the 6.1.50 package revision instead.

lsmod | grep -E '^vboxdrv|^vboxnetflt|^vboxnetadp'

Relevant output includes:

vboxnetadp             28672  0
vboxnetflt             36864  0
vboxdrv               696320  2 vboxnetadp,vboxnetflt

The module sizes can differ between Mint 22.x and 21.x, but the same three module names should appear when the install is healthy.

Add your account to the VirtualBox vboxusers group on Linux Mint

VirtualBox needs the vboxusers group for USB device access and some host integration features.

sudo usermod -aG vboxusers "$USER"

The -aG option appends vboxusers to your supplementary groups. Without -a, usermod can replace your existing secondary groups instead of adding one more.

Sign out and back in so the new group applies to a fresh login session, then confirm that vboxusers appears for your account.

groups "$USER"

Expected output includes vboxusers somewhere in the group list:

username : username adm cdrom sudo dip plugdev lpadmin sambashare vboxusers

Install VirtualBox from Oracle’s official repository

Use Oracle’s repository if you want the newer 7.2 branch or you prefer Oracle’s own package stream instead of the older Mint-packaged branches.

Oracle’s DEB822 source file uses Ubuntu codenames instead of Mint’s own release names, so pick the matching suite before you copy the repository block.

Linux Mint releaseMint codenameUbuntu baseUse this suite
Linux Mint 22.xWilma, Xia, Zara, ZenaUbuntu 24.04 LTSnoble
Linux Mint 21.xVanessa, Vera, Victoria, VirginiaUbuntu 22.04 LTSjammy

Confirm Oracle VirtualBox architecture support on Linux Mint

Oracle’s Linux host repository path here is for amd64 systems. Confirm your Mint install uses that architecture before writing the source file.

dpkg --print-architecture

Continue with Oracle’s repository only when the output is:

amd64

Install the Oracle repository tools for VirtualBox on Linux Mint

Oracle’s repo method needs curl, ca-certificates, and gpg so Mint can fetch and trust the signing key.

sudo apt update && sudo apt install curl ca-certificates gpg -y

If you do not usually work with curl, the curl command in Linux guide explains the -fsSL flags in more detail.

Import Oracle’s signing key for VirtualBox on Linux Mint

Store Oracle’s signing key in /usr/share/keyrings/ so APT can verify the repository without using the deprecated apt-key workflow.

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

The --yes flag lets the command overwrite the keyring cleanly if you rerun it later.

Linux Mint uses Ubuntu package bases here, so use noble on Mint 22.x and jammy on Mint 21.x. Do not substitute the Mint codenames in this source file.

Add the Oracle VirtualBox repository on Linux Mint 22.x

Mint 22.x is based on Ubuntu 24.04, so the Oracle source file needs the noble suite.

printf '%s\n' 'Types: deb' 'URIs: https://download.virtualbox.org/virtualbox/debian' 'Suites: noble' 'Components: contrib' 'Architectures: amd64' 'Signed-By: /usr/share/keyrings/virtualbox.gpg' | sudo tee /etc/apt/sources.list.d/virtualbox.sources > /dev/null

This uses sudo tee because a plain > redirect would try to write the root-owned file from your current shell instead of with elevated privileges.

Add the Oracle VirtualBox repository on Linux Mint 21.x

Mint 21.x is based on Ubuntu 22.04, so the same source file needs the jammy suite instead.

printf '%s\n' 'Types: deb' 'URIs: https://download.virtualbox.org/virtualbox/debian' 'Suites: jammy' 'Components: contrib' 'Architectures: amd64' 'Signed-By: /usr/share/keyrings/virtualbox.gpg' | sudo tee /etc/apt/sources.list.d/virtualbox.sources > /dev/null

Install Oracle VirtualBox 7.2 on Linux Mint

Refresh APT after writing the source file, confirm Oracle’s fetch lines, then install VirtualBox with the compiler, DKMS, and running-kernel headers needed to build the host modules.

sudo apt update

Relevant fetch lines include:

Get:1 https://download.virtualbox.org/virtualbox/debian noble InRelease [4,445 B]
Get:2 https://download.virtualbox.org/virtualbox/debian noble/contrib amd64 Packages [2,029 B]

Mint 21.x shows the same two lines with jammy in place of noble.

sudo apt install virtualbox-7.2 build-essential dkms "linux-headers-$(uname -r)" -y

Oracle’s package name is virtualbox-7.2. The extra packages provide make, compilers, DKMS, and matching headers for module rebuilds after kernel updates.

Verify the Oracle VirtualBox package on Linux Mint

This method uses the package name virtualbox-7.2, it installs vboxdrv.service, and it also adds /sbin/vboxconfig for later module rebuilds.

apt-cache policy virtualbox-7.2

Expected output on Mint 22.x looks like this:

virtualbox-7.2:
  Installed: 7.2.8-173730~Ubuntu~noble
  Candidate: 7.2.8-173730~Ubuntu~noble
  Version table:
 *** 7.2.8-173730~Ubuntu~noble 500
        500 https://download.virtualbox.org/virtualbox/debian noble/contrib amd64 Packages
        100 /var/lib/dpkg/status

Mint 21.x shows the same package revision pattern with jammy in the suffix and repository line.

systemctl is-active vboxdrv

Expected output is:

active

An active result means the Oracle helper loaded the host modules. If the command prints inactive or fails, use the kernel-module troubleshooting steps later in the article.

Install the VirtualBox Extension Pack on Linux Mint

The Extension Pack is optional. Skip it for basic VM creation; install it only if you need Oracle’s branch-specific add-ons, and match it to the exact VirtualBox version already installed on your Mint system.

Oracle changed the archive prefix between older 6.1 or 7.0 builds and current 7.2 builds, so the resolver command picks the right filename automatically. Run the resolver, download, checksum, and install commands in the same terminal session.

Oracle offers the pack for personal and educational use under its PUEL license.

Find the matching VirtualBox Extension Pack file

Start by extracting the installed VirtualBox version and probing the two archive names Oracle currently uses across supported branches.

VBOX_VERSION=$(vboxmanage -v | grep -oE '^[0-9]+(\.[0-9]+){2}')
EXTPACK_FILE=
for candidate in \
  "Oracle_VirtualBox_Extension_Pack-${VBOX_VERSION}.vbox-extpack" \
  "Oracle_VM_VirtualBox_Extension_Pack-${VBOX_VERSION}.vbox-extpack"
do
  EXTPACK_URL="https://download.virtualbox.org/virtualbox/${VBOX_VERSION}/${candidate}"
  if curl -fsI "$EXTPACK_URL" > /dev/null; then
    EXTPACK_FILE="$candidate"
    break
  fi
done
if [ -z "$EXTPACK_FILE" ]; then
  printf 'No matching Extension Pack was found for VirtualBox %s.\n' "$VBOX_VERSION" >&2
  false
fi
printf '%s\n' "$VBOX_VERSION" "$EXTPACK_FILE"

Example output for Oracle 7.2.8 looks like this:

7.2.8
Oracle_VirtualBox_Extension_Pack-7.2.8.vbox-extpack

Older 6.1 and 7.0 branches usually resolve to the longer Oracle_VM_VirtualBox_Extension_Pack-... filename instead.

Download the matching VirtualBox Extension Pack

Download the file name you just resolved, then verify Oracle’s checksum before installing it.

curl -fsSLo "$EXTPACK_FILE" "https://download.virtualbox.org/virtualbox/${VBOX_VERSION}/${EXTPACK_FILE}"
curl -fsSLo SHA256SUMS "https://download.virtualbox.org/virtualbox/${VBOX_VERSION}/SHA256SUMS"
grep -F "$EXTPACK_FILE" SHA256SUMS | sha256sum -c -

Expected checksum output for Oracle 7.2.8 looks like this:

Oracle_VirtualBox_Extension_Pack-7.2.8.vbox-extpack: OK

Install and verify the VirtualBox Extension Pack

Install the Extension Pack, accept the license prompt, then verify what your installed branch actually exposes.

sudo vboxmanage extpack install --replace "$EXTPACK_FILE"

The --replace flag lets VBoxManage upgrade an older Extension Pack in place.

sudo vboxmanage list extpacks

Example output for Oracle 7.2.8 looks like this:

Extension Packs: 1
Pack no. 0:   Oracle VirtualBox Extension Pack
Version:        7.2.8
Revision:       173730
Edition:
Description:    Oracle Cloud Infrastructure integration, PXE ROM.
VRDE Module:
Crypto Module:
Usable:         true
Why unusable:

Older 7.0 and 6.1 branches still report the longer Oracle VM VirtualBox Extension Pack name and a different description. sudo vboxmanage list extpacks is the reliable source for the system-wide pack state.

rm -f "$EXTPACK_FILE" SHA256SUMS

Launch VirtualBox on Linux Mint

The package installs from a terminal, but the VirtualBox Manager still needs a graphical session to open.

virtualbox

You can also launch VirtualBox from the applications menu by searching for VirtualBox or Oracle VM VirtualBox, depending on which package branch you installed.

Install VirtualBox Guest Additions Inside Your Virtual Machines

Guest Additions install inside each guest VM, not on the Linux Mint host. After you start a VM, open Devices > Insert Guest Additions CD Image from the VM window and follow the installer inside that guest operating system.

Linux guests usually need their own build tools and matching guest kernel headers before the installer will finish. Oracle’s VirtualBox manual is still the best reference for the guest-specific steps.

Troubleshoot VirtualBox on Linux Mint

The most common Linux Mint VirtualBox problems are missing kernel modules, Secure Boot blocking those modules, or USB access failing because the current login session never picked up vboxusers.

Fix VirtualBox kernel module problems on Linux Mint

The repair path depends on which installation method you used. The Linux Mint package verifies modules directly, while Oracle’s package adds vboxdrv.service and /sbin/vboxconfig.

Start by identifying the installed method and checking whether the host modules are loaded.

dpkg-query -W virtualbox virtualbox-dkms virtualbox-7.2 "linux-headers-$(uname -r)" 2>/dev/null || true
lsmod | grep -E '^vboxdrv|^vboxnetflt|^vboxnetadp' || true

If the Linux Mint packages are installed but no VirtualBox modules appear, reinstall the package, the DKMS build, and the matching headers for your running kernel.

sudo apt install --reinstall virtualbox virtualbox-dkms "linux-headers-$(uname -r)" -y

If Oracle’s package is installed, confirm its service state before rebuilding the modules.

systemctl is-active vboxdrv || true

Install any missing build prerequisites, then run the rebuild helper that ships with Oracle’s 7.2 package.

sudo apt install virtualbox-7.2 build-essential dkms "linux-headers-$(uname -r)" -y
sudo /sbin/vboxconfig

After either repair path, rerun the module check. If /sbin/vboxconfig returns command not found, you are almost certainly using the Linux Mint package rather than Oracle’s 7.2 package. Go back to the distro-package repair command instead of looking for a missing Oracle helper.

If APT reports compiler dependency problems, the guide on how to install GCC on Linux Mint can help you inspect the toolchain separately.

Handle Secure Boot when VirtualBox modules do not load on Linux Mint

Secure Boot can block VirtualBox modules even when the package itself installed cleanly.

sudo apt install mokutil -y
mokutil --sb-state

Legacy BIOS systems can return EFI variables are not supported on this system, which simply means Secure Boot is not active there. On UEFI systems that report Secure Boot as enabled, check for the DKMS MOK key Mint commonly stores on disk before importing it.

SecureBoot enabled
EFI variables are not supported on this system
if [ -f /var/lib/shim-signed/mok/MOK.der ]; then
  sudo mokutil --import /var/lib/shim-signed/mok/MOK.der
else
  printf '%s\n' 'DKMS MOK key not found at /var/lib/shim-signed/mok/MOK.der'
fi

Set a one-time password, reboot, choose Enroll MOK from the firmware prompt, and enter that password. After the reboot, rerun the module check for the method you installed.

Fix VirtualBox USB access errors on Linux Mint

The usual USB error on Linux Mint comes from missing vboxusers membership, a stale login session, or an optional Extension Pack that was never installed.

groups "$USER" | grep -w vboxusers || true
sudo vboxmanage list extpacks

If vboxusers is missing, sign out and back in after running the group command from the install section. If sudo vboxmanage list extpacks shows Extension Packs: 0, the base package is still installed correctly and only the optional add-on is missing.

Update or Remove VirtualBox on Linux Mint

Update VirtualBox from Linux Mint repositories

The distro package stays on the VirtualBox branch Linux Mint currently ships.

sudo apt update && sudo apt install --only-upgrade virtualbox -y

Update Oracle VirtualBox 7.2 on Linux Mint

Oracle’s package also updates through APT, but its package name stays versioned.

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

If the VirtualBox version changes, rerun the Extension Pack section so the add-on matches the new branch.

Remove the VirtualBox Extension Pack

Remove the optional Extension Pack before purging VirtualBox because vboxmanage provides the uninstall command. Skip this step if sudo vboxmanage list extpacks already shows Extension Packs: 0.

EXTPACK_NAME=$(sudo vboxmanage list extpacks | awk -F': +' '/Pack no\. 0:/ {print $2; exit}')
if [ -n "$EXTPACK_NAME" ]; then
  sudo vboxmanage extpack uninstall "$EXTPACK_NAME"
else
  printf '%s\n' 'No Extension Pack is installed.'
fi

The awk filter pulls the installed pack name from the system-wide VBoxManage output, which is safer than hardcoding a label that changed between older and newer VirtualBox branches.

Remove VirtualBox from Linux Mint repositories

Use this removal path only if you installed the plain virtualbox package from Linux Mint’s own repositories. It removes the GUI package and DKMS module package while leaving shared tools such as dkms and your kernel headers in place.

sudo apt purge virtualbox virtualbox-dkms virtualbox-qt

purge removes package configuration for the named VirtualBox packages. Review optional dependency cleanup separately before confirming any extra removals APT proposes.

sudo apt autoremove

Leave dkms and kernel headers installed if another driver package, such as a graphics or filesystem module, still uses them.

Remove Oracle VirtualBox 7.2 from Linux Mint

Use this removal path only if you installed virtualbox-7.2 from Oracle’s repository.

sudo apt purge virtualbox-7.2

Review optional dependency cleanup separately before confirming any extra removals APT proposes.

sudo apt autoremove

After removing the package, delete Oracle’s source file and key if you do not plan to use that repository again.

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

Remove vboxusers membership and user data

If you do not plan to reinstall VirtualBox, remove your account from the vboxusers group and sign out so the old access grant disappears from your next login session.

if groups "$USER" | grep -qw vboxusers; then
  sudo gpasswd -d "$USER" vboxusers
fi

Removing these paths permanently deletes your VirtualBox settings and any virtual machines stored in the default location. Keep backups of any guest disks you still need before you continue.

Check which VirtualBox data directories exist in your home directory before deleting anything.

find "$HOME" -maxdepth 2 \( -path "$HOME/.config/VirtualBox" -o -path "$HOME/VirtualBox VMs" \) -print

You will only see ~/VirtualBox VMs after you create at least one VM in the default location. If those paths are ones you want to remove, delete them with:

rm -rf "$HOME/.config/VirtualBox" "$HOME/VirtualBox VMs"

Conclusion

VirtualBox is ready on Linux Mint with the package source you chose, verified host modules, and a clear update or removal path. Create your first VM from VirtualBox Manager, then use Oracle’s VirtualBox manual when you need guest-specific storage, display, or Guest Additions details.

Share this guide

Help another Linux user troubleshoot faster

Share this guide with someone troubleshooting Linux systems or saving it for later.

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

6 thoughts on “How to Install VirtualBox on Linux Mint 22 and 21”

  1. Hello,
    Great tutorial that works perfectly on Linux Mint 22.

    Note that there is a typo on “Import the VirtualBox APT repository,” which mentions Mint 21 twice instead of Mint 22 in the box at the top.

    Thanks for these tutorials.

    Reply
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.

Verify before posting: