How to Install VirtualBox 7.0 on Linux Mint 22, 21 or 20

VirtualBox 7.0 is the latest major release of Oracle’s open-source virtualization software, offering numerous enhancements and new features. This release includes full VM encryption via CLI, secure boot support, a redesigned virtual machine wizard, and a new resource monitor utility for tracking performance metrics like CPU, RAM usage, and disk I/O. Additionally, VirtualBox 7.0 brings improved theme support across platforms, better multi-monitor handling, and support for DirectX 11 using DXVK for non-Windows hosts. These updates make VirtualBox 7.0 a robust and feature-rich solution for virtual machine management.

To install VirtualBox 7.0 on Linux Mint 22, 21, or 20, you can use Oracle’s official APT repository for the latest stable release and future upgrades. This guide will walk you through the installation process using the command-line terminal.

Import VirtualBox 7.0 APT Repository

Update Linux Mint Before VirtualBox 7.0 Installation

To ensure a smooth VirtualBox 7.0 installation, starting with an updated Linux Mint system is crucial. This step helps to avoid potential conflicts by ensuring all existing packages are current.

Execute the command below to refresh your package list:

sudo apt update

Following the update, bring all your system packages up to date with this command:

sudo apt upgrade

Install the Required Packages

VirtualBox 7.0 depends on specific packages for proper installation. These dependencies might already exist on your system, but verifying and installing any missing ones is essential.

Execute the following command to install necessary packages like ‘dirmngr’, ‘dkms’, and others:

sudo apt install dirmngr dkms ca-certificates software-properties-common apt-transport-https curl -y

If installation issues arise, revisit this step to ensure all required packages are installed correctly.

Import VirtualBox 7.0 GPG Key

Security is a priority, and verifying the authenticity of your installed packages is vital. Import the GPG key to confirm you’re obtaining the official VirtualBox packages. This step ensures the integrity and origin of the software. Use this command to import the GPG key:

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 APT Repository

With the GPG key added, the next step involves integrating the official VirtualBox repository into your system. Depending on your version of Linux Mint, the command varies:

The first option is if you are using the latest Linux Mint 22 release, use the following command:

echo deb [arch=amd64 signed-by=/usr/share/keyrings/virtualbox.gpg] http://download.virtualbox.org/virtualbox/debian noble contrib | sudo tee /etc/apt/sources.list.d/virtualbox.list

The second option is if you are using the latest Linux Mint 21 release, 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, if you are still on the old stable release of Linux Mint 20, use 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

To finalize, update your system’s repository list to recognize the newly added VirtualBox repository:

sudo apt update

Finalize VirtualBox 7.0 Installation

Install VirtualBox 7.0 and Linux Headers via APT Command

Initiate the installation of VirtualBox 7.0 by executing the following command. This action installs VirtualBox and ensures that the Linux headers matching your current kernel version are installed. These headers are vital for the proper functioning of VirtualBox on your system:

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

Verify VirtualBox 7.0 Installation

As an optional but recommended step, verify the source of your VirtualBox installation. Use the apt-cache policy command to display the installed package’s details, including its version and originating repository:

apt-cache policy virtualbox-7.0

Cross-reference the output to ensure that it lists VirtualBox 7.0 and originates from the official VirtualBox repository you added previously.

Check VirtualBox 7.0 Service Status

To confirm the operational status of the vboxdrv service, which manages the kernel modules for VirtualBox, execute the command below:

systemctl status vboxdrv

The output will indicate the service’s current state. An active and running status signifies a successful installation.

Enable and Start the VirtualBox Service (If Necessary)

Occasionally, the vboxdrv service may not activate automatically post-installation. To ensure the service is operational and set to start on boot, use the following command:

sudo systemctl enable vboxdrv --now

Executing this command guarantees the VirtualBox service is active and ready, preparing your system to use VirtualBox 7.0 efficiently.

Launch VirtualBox 7.0 User Interface

Now that you have successfully installed VirtualBox 7.0 and confirmed that the necessary service is running, you can launch the application to create and manage virtual machines.

CLI Command to Launch VirtualBox 7.0

If you prefer to launch VirtualBox directly from your terminal, run the following command:

virtualbox

This command opens the VirtualBox application, allowing you to manage virtual machines from the terminal.

GUI Method to Launch VirtualBox 7.0

Launching VirtualBox through the graphical interface is more convenient for most desktop users. To do this, follow the steps below:

  1. Click on the Taskbar or Menu button, typically located at the bottom-left corner of your screen.
  2. Navigate to the Administration section or search for “VirtualBox” using the built-in search functionality.
  3. Click on Oracle VM VirtualBox to launch the application.

Install VirtualBox Extension Pack

Download VirtualBox 7.0 Extension Pack

The Extension Pack offers additional functionalities to enhance your VirtualBox setup. It’s crucial to download the version that matches your installed VirtualBox.

First, ascertain your VirtualBox version with this command:

vboxmanage -v | cut -dr -f1

This command outputs the version, for example, 7.0.x. Use the following wget command to download the Extension Pack that corresponds with your version:

wget https://download.virtualbox.org/virtualbox/7.0.x/Oracle_VM_VirtualBox_Extension_Pack-7.0.x.vbox-extpack

Make sure to replace 7.0.x in the URL with your specific VirtualBox version.

Install VirtualBox 7.0 Extension Pack

Once downloaded, install the Extension Pack using the vboxmanage command. This process requires administrative privileges and acceptance of Oracle’s license terms:

sudo vboxmanage extpack install Oracle_VM_VirtualBox_Extension_Pack-7.0.x.vbox-extpack

When prompted, type “y” and press Enter to agree to the terms and proceed with the installation.

Verify Installed Extension Pack Version

Post-installation, verify the installed Extension Pack version to ensure correct installation. Use this command to check:

vboxmanage list extpacks

This command will list all installed Extension Packs, including their version numbers.

Add User to vboxusers Group on Linux Mint

For complete functionality in VirtualBox, your user account must be part of the vboxusers group. Add your account to this group with the following command:

sudo usermod -a -G vboxusers $USER

After executing this command, reboot your system to apply these changes. Upon logging back in, verify your account’s group membership:

groups $USER

This command lists all groups associated with your user account. Confirm that vboxusers is included in this list.

Managing VirtualBox 7.0

Update VirtualBox 7.0

Maintaining an up-to-date VirtualBox installation is essential for security and functionality. Regularly check for and install updates using these commands in your terminal:

sudo apt update && sudo apt upgrade

Regularly updating, ideally weekly, ensures your VirtualBox installation remains secure and incorporates the latest features and fixes.

Remove VirtualBox 7.0

In instances where VirtualBox is no longer needed, you can remove it from your system. To uninstall VirtualBox 7.0, execute the following command:

sudo apt remove virtualbox-7.0

After removing VirtualBox, it’s advisable to delete the repository sources file to prevent future updates. Use this command for removal:

sudo rm /etc/apt/sources.list.d/virtualbox.list

Additionally, if you wish to remove the GPG key associated with the VirtualBox repository, proceed with this command:

sudo rm /usr/share/keyrings/virtualbox.gpg

This comprehensive approach ensures that all components related to VirtualBox are entirely removed from your system.

Conclusion

With VirtualBox 7.0 successfully installed on your Linux Mint system, you can leverage its latest features and enhancements for efficient virtual machine management. Using Oracle’s official APT repository ensures you stay up-to-date with the newest stable releases and improvements. Enjoy the powerful capabilities of VirtualBox 7.0 to run multiple operating systems seamlessly on your Linux Mint setup.

6 thoughts on “How to Install VirtualBox 7.0 on Linux Mint 22, 21 or 20”

  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

Leave a Comment