Virtualbox is not included in the default repositories of Linux Mint, which means in order to be able to install Virtualbox via apt on Linux Mint, first you must setup Virtualbox repository.
In this tutorial, you will learn how to install Virtualbox on Linux Mint 21.
Step 1 - Update Linux Mint 21
Before installing Virtualbox, ensure that your Linux Mint machine doesn't have outdated packages on it.
To check for updates on Linux Mint, there are various ways to do so. However, in this tutorial, we'll be updating and upgrading packages that needs to be upgraded via the terminal by using apt package manager.
So, launch your terminal, by pressing CTRL + ALT + T, and run the command below to update all packages on Linux Mint.
sudo apt update && apt upgrade -y
Step 2 - Add Virtualbox GPG Key on Linux Mint 21
Once you have updated packages on your Linux Mint machine. Now you need to ad Virtualbox GPG key on your system.
Adding the GPG key of Virtualbox, can be done by using wget.
To do so, simply run the command below.
wget -qO- https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --dearmor --yes --output /usr/share/keyrings/oracle-virtualbox-2016.gpg
sudo apt install wget
.Step 3 - Setup Virtualbox Repository on Linux Mint 21
After downloading Virtualbox GPG key, proceed to set up Virtualbox repository on your system.
Virtualbox repository allows you to download and install Virtualbox on Linux, including Linux Mint, easily from the terminal by using apt package manager.
Setting up Virtualbox repository is quite simple, and all you need to do is, run the command below.
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian jammy contrib' | sudo tee -a /etc/apt/sources.list
Note: Once you run the command above, a new entry containing Virtualbox repository will be added on sources.list
file.
Step 4 - Update Linux Mint 21
Once you have created Virtualbox repository on your Linux Mint 21 machine, you must update the package database in order to be able to use Virtualbox repository.
To do so, simply execute the following.
sudo apt update
Virtualbox repository should now be added on your system, and it should appear on the output as shown in the screenshot below.
Step 5 - Install Virtualbox 7.0 on Linux Mint
Once you have verified that Virtualbox repository is active, and can be used. You can proceed to install Virtualbox on your machine.
Installing Virtualbox on Linux Mint is quite simple, and it can be done by using apt package manager.
The latest version of Virtualbox, is Virtualbox 7.0, so to install Virtualbox 7.0 on Linux Mint, simply run the command below.
sudo apt install virtualbox-7.0
Step 6 - Install Virtualbox Extension pack
In this tutorial, we installed Virtualbox 7.0.14, so in order to be able to use Extension pack functionalities on your system, you must install the same version of Extension pack as Virtualbox.
First download Extension pack using wget.
wget https://download.virtualbox.org/virtualbox/7.0.14/Oracle_VM_VirtualBox_Extension_Pack-7.0.14.vbox-extpack
To install Extension pack is very easy, to do so, simply run the command below.
sudo vboxmanage install extpack Oracle_VM_VirtualBox_Extension_Pack-7.0.14.vbox-extpack
Next, you will see the following prompt, simply accept Extension pack license terms by pressing Y, and then enter.
Once Extension pack installed, you will see the following output "Successfully installed Oracle VM VirtualBox Extension pack" on your terminal.
Step 7 - Verify Extension pack installation
Now that Extension pack is installed on your system, you need to verify that extension pack and that the correct version was installed.
To do so, simply check Extension pack by running the command below.
VBoxManage list extpacks
As you can see, we installed Extension pack version 7.0.14.
Step 8 - Add User to vboxusers Group
If you are planning to use an USB drive on your Virtual machines, then you must first add the user on the vboxusers group.
Adding your user account on vboxusers group is needed in order to enable USB support on Virtualbox
To add your user account on vboxusers group, simply run the command below.
sudo usermod -a -G vboxusers $USER
Once you add user to vboxusers group, verify that the user was added correctly.
groups $USER
As you can see our user owlhowto
is now added to vboxusers
user group.
Step 9 - Launch Virtualbox 7.0 on Linux Mint
If you are a terminal fan, and want to launch Virtualbox by using the terminal, then simply execute the command below to do so.
virtualbox
If you prefer using GUI to launch Virtualbox, you should be able to do so by launching Virtualbox from the Linux Mint Menu.
Mint Menu> Search: Virtualbox > Virtualbox
Uninstalling Virtualbox 7.0 on Linux Mint
We used apt package manager to install Virtualbox 7.0 on Linux Mint 21, which means apt can also be used to uninstall Virtualbox.
To uninstall Virtualbox 7.0 on Linux Mint, simply run the following.
sudo apt remove virtualbox-7.0
Then confirm by pressing Y key, and then enter to finally remove Virtualbox.
Conclusion
In this tutorial, you learned how to install Virtualbox 7.0 on Linux Mint, via the official Virtualbox Repository.
By now you should be able to use Virtualbox, to create and manage Virtual machines on Linux Mint.