How to install VirtualBox on Ubuntu 22.04?

In this easy tutorial, we will install Oracle VirtualBox on Ubuntu.

Running VirtualBox inside Ubuntu
Running VirtualBox on Ubuntu


  • Ubuntu Desktop – Running Ubuntu 22.04 or Ubuntu 20.04 installed
  • Internet connection

Step #1 Update your Ubuntu Packages & upgrade them.

Open a terminal window and run the package upgrade first.

Updating your Ubuntu Machine package inventory:

sudo apt update -y

Upgrade packages

sudo apt upgrade -y

Reboot your Ubuntu Machine. At this point, your Ubuntu machine is ready to install VirtualBox

Step #2 Install Oracle VirtualBox

This is a very straightforward process, you can run the below command from the command line, and your VirtualBox will get installed.

sudo apt install virtualbox

Confirm with Y to proceed with the installation (shown below).

VirtualBox installation step, from commandline.

Your VirtualBox will get installed from the official Ubuntu package repository, and you can start creating Virtual Machines inside it!

FAQ: Why I used apt instead of apt-get?

Yes, that is the preferred method. please refer to this page for more details:

VirtualBox installation on Ubuntu 22.04 and earlier versions

There are no significat difference in installation steps for Oracle VirtualBox on Ubuntu 22.04 and earlier versions, such as Ubuntu 20.04. In this example, I used Ubuntu 20.04

This guide explained how to install VirtualBox on Ubuntu. If you are looking for the steps to install Ubuntu on VirtualBox, please refer to this guide: Ubuntu on VirtualBox – Checklist for installing Ubuntu 22.04 lts VM