
VirtualBox is a free and open-source cross-platform virtualization tool developed and maintained by Oracle. It allows you to create and run virtual machines on your host system without the need for procuring another physical machine. Thus, It's a cost-effective solution when you need to try out an operating system. Join us as we install VirtualBox on Ubuntu 20.04.
VirtualBox is easy to install and has great community support out there. It is highly recommended for users who are new to virtualization and who want to try out various operating systems. Without much further ado, let's get started.
This tutorial will show you two ways to install VirtualBox on Ubuntu 20.04:
- From the standard Ubuntu repositories.
- From the Oracle repositories.
Installing VirtualBox from Ubuntu repository
This is the simplest way of installing VirtualBox on Ubuntu . First, we update our packages and then install VirtualBox and Extension Pack.
First, update the package lists:
$ sudo apt update
Once the package index is updates, install VirtualBox and extension packs as shown.
$ sudo apt install virtualbox virtualbox-ext-pack

As the installation of packages gets underway, a pop-up window will appear prompting you to read the Personal Use and Evaluation License (PUEL). Once you are done, press 'ENTER' to proceed.

Select 'Yes' to accept the VirtualBox PUEL license.

Thereafter, the installation of all the packages and dependencies required will continue and complete successfully.
Installing VirtualBox from Oracle repository
The other way to install VirtualBox is installing from the Oracle repository. To achieve this, follow the steps outlined below:
Step 1: Import the Oracle public keys
Run the commands below to import oracle public keys:
$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
$ wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
The above commands output OK.
Step 2: Add VirtualBox Repository to Ubuntu
Next, we add the Oracle virtual box PPA to our Ubuntu system.
$ echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" | \ sudo tee -a /etc/apt/sources.list.d/virtualbox.list
Step 3: Install VirtualBox
Finally, to install VirtualBox, Update the package lists as shown.
$ sudo apt update
And then install the latest version of VirtualBox:
$ sudo apt install virtualbox-6.1
Installing VirtualBox Extension Pack
The VirtualBox Extension Pack extends the functionality of virtualbox. It provides useful functionality for virtual machines such as support for USB 2.0 and USB 3.0 devices.
To download the virtual box extension pack run the command:
$ wget https://download.virtualbox.org/virtualbox/6.1.8/Oracle_VM_VirtualBox_Extension_Pack-6.1.8.vbox-extpack
The version of the Extension Pack should match the installed VirtualBox version.
Once the download is complete, import the extension pack using the following command:
$ sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.1.8.vbox-extpack
You will be asked to accept their terms and conditions of the Oracle license. Type 'y' and press Enter. Once the installation is completed, you will see the output below:
Starting VirtualBox
Launch VirtualBox from the command line by typing Virtualbox. Also, you can use the applications manager to search for VirtualBox as shown.

To launch VirtualBox, click on the icon and the VirtualBox UI will be displayed a shown.

Conclusion
You have learned how to install VirtualBox on Ubuntu 20.04. From here, you can get started by creating virtual machines and trying out various operating systems. Send us a shout and let us know how the installation went on your side.