Guides 11792 Published by

The guide walks users through installing VirtualBox 7.0 on Mint 21 or 20 by first making sure kernel headers, build tools, and curl are installed. It then adds Oracle’s official repository, updates the package list, and installs the latest 7.0 release to avoid the older default version that lacks newer host‑only adapter support. After installation, users launch VirtualBox once to trigger a fresh build of the kernel module with vboxconfig or dkms autoinstall—an essential step whenever the kernel has been upgraded. Finally it recommends verifying the setup by checking the About dialog and inspecting log files for any driver or permission issues.



How to Install VirtualBox 7.0 on Linux Mint 21/20

If you’re looking to run Windows or another Linux distro inside a VM on Mint, the latest VirtualBox 7.0 gives you better hardware support and new features. Below is a no‑fuss guide that gets you up and running in minutes.

Prerequisites you might already have
  • Kernel headers – You need the same version as your running kernel (sudo apt install linux-headers-$(uname -r)).
  • Build tools – build-essential, dkms and gcc are required for compiling the VM kernel modules.
  • Curl – For downloading Oracle’s repository key.

If you’re not sure whether those packages are installed, run:

sudo apt update && sudo apt install -y linux-headers-$(uname -r) build-essential dkms gcc curl

Why this matters: VirtualBox ships a kernel module that must compile against your current kernel. Without headers or build tools the VM will fail to start.

Adding Oracle’s repository

Oracle provides an official repo for VirtualBox 7.0, which keeps you on the latest patch level and resolves dependency quirks that show up when installing from a generic Ubuntu package.

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc \
     -O- | sudo apt-key add -
echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" |
    sudo tee /etc/apt/sources.list.d/virtualbox.list

Then refresh your package list:

sudo apt update

I’ve seen users hit a snag when they used the Ubuntu 20.04 repo on Mint 21; the kernel module would fail to build because it pulls an older linux-headers package.

Installing VirtualBox 7.0

With the repository in place, just install:

sudo apt install -y virtualbox-7.0

That pulls in the latest 7.0 release and its matching kernel module.

Why this step is critical: If you skip adding Oracle’s repo and install from the default Mint repos, you’ll get an older VirtualBox (6.x) that lacks support for newer host‑only adapters and may refuse to run on recent kernels.

Fixing potential kernel module issues

After installation, start VirtualBox once:

virtualbox

If it complains about a missing vboxdrv module or “VirtualBox not loaded”, rebuild the module manually:

sudo /sbin/vboxconfig

Or run:

sudo dkms autoinstall

Why you need to do this: New kernels after Mint upgrades sometimes break the pre‑compiled module. Running vboxconfig forces a fresh build against your current headers.

Common hiccup

I’ve seen users get an “Invalid kernel version” error right after a kernel upgrade. The fix is to reinstall the kernel headers sudo apt install --reinstall linux-headers-$(uname -r) and then run vboxconfig again.

Verify installation

Open VirtualBox, go to Help => About – you should see “VirtualBox 7.x” in the header. Create a new VM or start an existing one to confirm that networking and graphics work as expected.

If you hit a snag, check the log file (~/.config/VirtualBox/VBox.log) for clues; often it points to missing drivers or permission issues with /dev/vbox.

That’s all there is to it. You’ve got VirtualBox 7.0 on Mint 21 or 20, ready to host any guest OS you need.