Commands to Install VirtualBox 7.0 on Ubuntu 22.04 or 20.04

Learn how to install the recently launched version VirtualBox 7.0.x or upgrade the existing one on Ubuntu 22.04 Jammy or Ubuntu 20.04 Focal LTS using the command terminal.

We already have the Virtualbox to install on Ubuntu 22.04 or 20.04 using their official repository. However, the version available through it will not be the latest one. Well, you would already know about this open-source platform. It is developed by Oracle to run virtual machines on Windows, Linux, and macOS using virtualization technology.

The updated version of VirtualBox has many improvements some of them are: Virtual machines can be fully encrypted now; Improved theme support on all platforms; reworked the new VM wizard to integrate the unattended guest OS installation; Added a new utility similar to “top” or “resource monitor” and more. For a full list, one can visit the official change log page.

Steps to install VirtualBox 7.0 on Ubuntu 22.04 or 20.04

1. Install system updates

Let’s start with the update command to get the latest available versions of system packages. Apart from that, we will also install a few other tools.

sudo apt update && sudo apt upgrade -y && sudo apt install dirmngr ca-certificates software-properties-common apt-transport-https curl

2. Add VirtualBox Repository on Ubuntu

We already have the VirtualBox to install using the system repository of both Ubuntu 22.04 and 20.04, however, the version is old. Therefore, we add manually the repository of Virtualbox provided by their team.

For Ubuntu 22.04 LTS

echo deb [arch=amd64 signed-by=/usr/share/keyrings/virtualbox.gpg] jammy contrib | sudo tee /etc/apt/sources.list.d/virtualbox.list

For Ubuntu 20.04 LTS

echo deb [arch=amd64 signed-by=/usr/share/keyrings/virtualbox.gpg] focal contrib | sudo tee /etc/apt/sources.list.d/virtualbox.list

3. Import the GPG Key

After adding the repository, the system needs the GPG key that has been used to sign the packages available to download through it. Therefore, for that, run the below command. It will be the same for both Ubuntu 22.04 and Ubuntu 20.04.

curl -fSsL | gpg --dearmor | sudo tee /usr/share/keyrings/virtualbox.gpg > /dev/null

Run the system update command again to refresh the APT package index cache.

sudo apt update

4. Installing VirtualBox 7.0 on Ubuntu 22.04 or 20.04

Finally, we have the repository to install the latest available version of VirtualBox on our Linux system. Let’s run the installation command using the APT.

sudo apt install virtualbox-7.0

5. Start the Oracle VirtualBox

Once the installation is completed, then to start it, we can either use the command terminal or the application launcher. For that go to the application launcher and there you can search for VirtualBox.

In Terminal, use:


From Application launcher

Start the Virtualbox
Install the virtualbox version 7.0 on Ubuntu 22.04 or 20.04

6. Updating VirtualBox  on Debian or Ubuntu

If you are using any Debian-based system and have added its repository manually as we did here in this tutorial. Then to update to its latest available version, we just need to run the system update and upgrade command, given here.

sudo apt update && sudo apt upgrade

7. How to uninstall VirtualBox from Ubuntu 22.04 or 20.04

Well, if you think you don’t want it then we have a command to completely remove the VirtualBox from Ubuntu Linux.

sudo apt autoremove --purge virtualbox-7.0

To remove the GPG and Repo as well use the given command. However, if you plan to install this virtualization platform again in the future then don’t do it.

sudo rm /etc/apt/sources.list.d/virtualbox.list /usr/share/keyrings/virtualbox.gpg

Other Articles 

How to install Ubuntu 22.04 Server on VirtualBox
Installing Virtualbox App on Debian 11 Bullseye
Download Rocky Linux 8 ISO to install on VirtualBox
How to install Virtualbox on Manjaro Linux’s latest version

1 thought on “Commands to Install VirtualBox 7.0 on Ubuntu 22.04 or 20.04”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.