VirtualBox 7.0 is the latest free and open-source (FOSS) hypervisor version. In the following tutorial, you will learn how to install VirtualBox 7.0 on Linux Mint 21 or Linux Mint 20 release by importing the official virtual box repository and installing the most up-to-date version using the command line terminal. The extra benefit for users using this method is that you will receive them instantly from the VirtualBox repository when updates drop instead of waiting for improvements or security fixes to be ported down by the Linux Mint team or Ubuntu.
Table of Contents
Update Linux Mint
First, update your system to ensure all existing packages are up to date to avoid potential conflict issues during the installation.
First, update your system to ensure all existing packages are up to date.
sudo apt update
Optionally, you can list the updates for users who require review or are curious to see what is available to update. This can be good if you have a specific you forgot to place; use the apt-hold command.
sudo apt --list upgradable
Proceed to upgrade any outdated packages using the following command.
sudo apt upgrade
Import GPG Key & Repository
Install Required Packages
The following dependencies will need to be installed to install VirtualBox successfully. Most of these packages are already on your system, but running the command can help ensure they’re installed.
sudo apt install dirmngr dkms ca-certificates software-properties-common gnupg gnupg2 apt-transport-https curl -y
If you skip and encounter issues, return and just run the command.
Import the GPG Key
The first step in installing VirtualBox latest build is first to add the GPG key to verify the authenticity of the packages.
curl -fSsL https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --dearmor | sudo tee /usr/share/keyrings/virtualbox.gpg > /dev/null
Import VirtualBox Repository
The next step is to import the official repository from VirtualBox now.
Linux Mint 21. xx distribution users, use the following command.
echo deb [arch=amd64 signed-by=/usr/share/keyrings/virtualbox.gpg] http://download.virtualbox.org/virtualbox/debian jammy contrib | sudo tee /etc/apt/sources.list.d/virtualbox.list
Lastly, for Linux Mint 20. xx distribution users who have not upgraded yet, you can install VirtualBox 7.0 using the following command.
echo deb [arch=amd64 signed-by=/usr/share/keyrings/virtualbox.gpg] http://download.virtualbox.org/virtualbox/debian focal contrib | sudo tee /etc/apt/sources.list.d/virtualbox.list
Now, update your repository list to reflect the new additions.
sudo apt update
Install VirtualBox 7.0
With the setup complete, execute the installation command to install VirtualBox.
sudo apt install virtualbox-7.0 linux-headers-$(uname -r) -y
Optionally, ensure that the VirtualBox installation was pulled directly from the source repository and check the current version installed using the apt-cache policy command.
apt-cache policy virtualbox-7.0
Example output:
Confirm if VirtualBox was installed successfully. Check the current status as follows.
systemctl status vboxdrv
Example output:
If by chance this has not been activated, which by default it is when installing, use the following command that will start the service and enable it to be active from system boot.
sudo systemctl enable vboxdrv --now
How to Launch VirtualBox 7.0
VirtualBox can be launched immediately from your terminal if opened with the following command.
virtualbox
However, many users on desktops would use the following desktop path.
Taskbar > Administration > Oracle VM Virtualbox
Example:
Once open, you will arrive at the main screen, where you can begin to create virtual machines. It is very similar for users coming from VMWare, and users new to virtual machines should check out the VirtualBox user manual.
Example:
Additional Commands & Tips
How to Update VirtualBox
Updating VirtualBox can be done using the command line terminal with the following standard commands you would have used at the start of the tutorial to check your system for updates.
sudo apt update && sudo apt upgrade
Most newer Linux users usually set up automatic updates or rely on the notifications from their desktop, especially from a Windows-type background. You should always check using the terminal at least once weekly to ensure you are not missing any updates. The terminal method will grab all available updates, ensuring your system is up-to-date.
How to Remove/Uninstall VirtualBox 7.0
The removal of VirtualBox is straightforward. For users that want to remove the software entirely, use the following command.
sudo apt autoremove virtualbox-7.0 --purge
Note that this will delete all data, including all database data added with the –purge flag. Do not use the purge end flag if you wish to keep the data.
Next, remove the repository sources file using the following command.
sudo rm /etc/apt/sources.list.d/virtualbox.list
Optionally, you can remove the GPG key if you prefer.
sudo rm /usr/share/keyrings/virtualbox.gpg
Conclusion
VirtualBox should be one of your go-to options if you’re in the market for reliable and feature-rich virtual machine software. The tutorial has demonstrated how to install the latest version on your Linux Mint desktop by utilizing the official APT repository for the latest up-to-date version at all times.
For more information, visit the VirtualBox 7.0 changelog.