Install the latest version of VirtualBox in Linux Mint.
I have installed the latest Linux Mint 21. Unfortunately, it still comes with the old version of VirtualBox. Normally this is not a big deal, but the 7 version has some great improvements, such as support for Windows 11.
Check which version is available
But first, let’s check which version is in the package sources. It is quite possible that this will change in the future and we can save ourselves all the trouble here. This can be done with the following command
apt-get -s install virtualbox
The parameter causes the installation to be simulated only. We see the version number in the output. We also see that we are using “jammy”. We’ll need that in a moment.
Install VirtualBox 7
There are various ways to install the latest version. You can download the current version from the download page, e.g. as a .deb file.
However, this has the disadvantage that updates are not installed automatically. We therefore choose the alternative and add the VirtualBox repository to our package sources.
We start with the GPG key:
sudo apt install curl wget gnupg2 lsb-release y curl -fsSL https://www.virtualbox.org/download/oracle_vbox_2016.asc|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/vbox.gpg curl -fsSL https://www.virtualbox.org/download/oracle_vbox.asc|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/oracle_vbox.gpg
We then add the package source to our system. Note, here we see the “jammy” from the screenshot above. Adjust accordingly for newer versions of Linux.
echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian jammy contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
Once this is done, we can install VirtualBox. To do this, we update the package sources, download the Linux headers and then install VirtualBox.
sudo apt update sudo apt install -y linux-headers-$(uname -r) dkms sudo apt install virtualbox-7.0 -y
Finally, we add our user to the “vboxusers” group.
sudo usermod -aG vboxusers $USER newgrp vboxusers
VirtualBox can then be started.