How to Install VirtualBox on Ubuntu 18.04

Install VirtualBox on Ubuntu 18.04

VirtualBox is a free open source virtualization software allows you to run multiple operating systems. VirtualBox is also a cross-platform software which is available for Linux, Windows, and MacOS etc. operating systems. Ubuntu global repository also supports VirtualBox installation through it, but it always does not provides the latest version of VirtualBox. So the Best way to install the latest VirtualBox version is through Oracle repositories. In this tutorial you are going to learn how to install VirtualBox on Ubuntu 18.04 using the following two methods:

  1. Install VirtualBox from Oracle Repositories.
  2. Install VirtualBox from Ubuntu Repositories.


Before you start to install VirtualBox on Ubuntu 18.04. You must have the credentials of the user with sudo privileges.

Method 1: Install VirtualBox from Oracle Repositories

Here in this method, we will install VirtualBox from Oracle Repositories. At the time of writing this tutorial, the current latest version available is 6.0.4. You can also check the latest version visiting VirtualBox download page.

First, Install software-properties-common package which is required for add-apt-repository command execution by typing following command in terminal:

sudo apt install software-properties-common

Now import GPG keys of VirtualBox Repositories provided by Oracle using following wget commands. On successfully importing GPG key you will see OK as output:

wget -q -O- | sudo apt-key add -
wget -q -O- | sudo apt-key add -

After importing GPG key add VirtualBox repository using the add-apt-repository command:

sudo add-apt-repository "deb [arch=amd64] $(lsb_release -cs) contrib"

Update the apt package manager index by typing:

sudo apt update

Now install VirtualBox typing following command:

sudo apt install virtualbox-6.0

Install VirtualBox Extension Pack

To get some additional features you should install VirtualBox Extension Pack. Which provides features like support for images encryption, virtual USB 2.0 and 3.0 devices etc. To download Extension pack run below command:


After the download completes, import the extension package using VBoxManage command typing:

sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.0.4.vbox-extpack

It will ask you the following question:

Do you agree to these license terms and conditions (y/n)?

Enter ‘y’ to continue, after completing import you will see the following output:

Successfully installed "Oracle VM VirtualBox Extension Pack".

Method 2: Installing VirtualBox from Ubuntu Repositories

Here in this method, we will install VirtualBox from Ubuntu Repositories And the VirtualBox Extension Pack for it.

Update the apt package manager index typing:

sudo apt update

To install VirtualBox and VirtualBox Extension Pack run below command:

sudo apt install virtualbox virtualbox-ext-pack

Start VirtualBox

You can start VirtualBox in two ways first from command line typing  virtualbox and visiting Activities -> Oracle VM VirtualBox using Activities.

How to Install VirtualBox on Ubuntu 18.04
How to Install VirtualBox on Ubuntu 18.04


You have successfully learned how to install VirtualBox on Ubuntu 18.04. If you have any queries please don’t forget to comment below.