How to Install VirtualBox on Ubuntu 20.04

VirtualBox is a free and open-source hypervisor for x86 and x86-64 virtualization, which the Oracle Corporation develops. The software targets users wishing to create virtual environments for servers and desktops that allow users and administrations to run multiple guest operating systems on a single computer for either testing methods or production use. VirtualBox may be installed on Windows, macOS, Linux, Solaris, and OpenSolaris.

In the following tutorial, you will learn how to install VirtualBox on your Ubuntu 20.04 LTS operating system along with creating a new Virtual Machine from scratch.

Prerequisites

  • Recommended OS: Ubuntu 20.04 – optional (Ubuntu 21.04)
  • User account: A user account with sudo or root access.
  • Required Packages: wget

Updating Operating System

Update your Ubuntu 20.04 operating system to make sure all existing packages are up to date:

sudo apt update && sudo apt upgrade

Advertisement


Install VirtualBox

Import the GPG Key

The first step in installing VirtualBox latest build is first to add the GPG key:

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -

Example output if successful:

OK

Import VirtualBox Repository

The next step once the GPG key is imported is to add the repository as follows:

echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian focal contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list

Now, update your repository list to reflect the new additions.

sudo apt update

Install VirtualBox

With the setup complete, execute the installation command to install VirtualBox:

sudo apt install virtualbox-6.1 

Example of dependencies installed with VirtualBox:

How to Install VirtualBox on Ubuntu 20.04

To confirm if VirtualBox was installed successfully, check the current status as follows:

systemctl status vboxdrv

Example output:

How to Install VirtualBox on Ubuntu 20.04

How to Use VirtualBox

How to Launch VirtualBox

To launch VirtualBox, you have two options. The first is to use the terminal command:

virtualbox

However, many users on desktops would use Show Applications > Virtualbox

Example:

How to Install VirtualBox on Ubuntu 20.04

Add & Setup New VM

To create and configure a new VM with VirtualBox is a straightforward process as follows. The tutorial will create a VM with the Linux profile for creating a Ubuntu 21.04 Desktop VM.

Step 1. Once VirtualBox is open, click on the New button as below:

How to Install VirtualBox on Ubuntu 20.04

Step 2. For the tutorial, it was stated the VM creation of choice would be Ubuntu 21.04. Name your VM, then click “Type Linux” and if it hasn’t been automatically selected for you select “Version: Ubuntu_64”.

Hint, if you name the VM the operating system, you install it’ll automatically pick the version for you.

Click the Next > button to proceed.

How to Install VirtualBox on Ubuntu 20.04

Step 3. The next window you will see is the select Memory (RAM) option. The default is 1024 MB; however, for most systems, you will need to increase this. A handy tip is to look at the min specs and determine how much memory your VM OS will require or expand to a healthy margin.

As shown below, the tutorial guest machine increased the margin to roughly 4GB. Once done, click the Next > button.

How to Install VirtualBox on Ubuntu 20.04

Step 4. Create or use an existing hard drive setup. Most users will typically Create a virtual hard disk now an option when creating a new VM.

Select this option and click Create button.

How to Install VirtualBox on Ubuntu 20.04

Step 5. When choosing the virtual storage allocation method, VDI (VirtualBox Disk Image) is recommended.

Click on the Next > button to proceed.

How to Install VirtualBox on Ubuntu 20.04

Step 6. Dynamically allocated when running a guest machine for best performance in disk allocation.

Click on the Next > button to proceed.

How to Install VirtualBox on Ubuntu 20.04

Step 7. Select the file location if the default isn’t reasonable for you. Lastly, set the time of the virtual hard disk.

Once configured, click on the Create button to finish up.

How to Install VirtualBox on Ubuntu 20.04

Step 8. You will now come to an overview of the virtual machine you just created. You can modify the settings of your VM in this overview now and in the future. Note, if you want to change settings, the virtual machine much be shut down.

To proceed with the Ubuntu 21.04 Desktop installation, click on the Start button as below:

How to Install VirtualBox on Ubuntu 20.04

Step 9. The first screen will appear when starting your VM for the first time, which will prompt you to select your ISO as the start-up disk.

Click on the icon folder as the example below.

How to Install VirtualBox on Ubuntu 20.04

Click on the Add + button on the top left corner as below:

How to Install VirtualBox on Ubuntu 20.04

Step 10. Now locate the directory and the ISO file, select it and click on the Open button:

How to Install VirtualBox on Ubuntu 20.04

Step 12. Click on the newly added ISO option, and this may take a second or three to sync up in the directory.

Once you have selected the ISO installation option, click on Choose button.

How to Install VirtualBox on Ubuntu 20.04

Step 13. In the last step, you can see the ISO file now in the start-up disk option to install.

Click on the Start button to install your VM OS system.

How to Install VirtualBox on Ubuntu 20.04

This will begin installing the chosen operating system; this was Ubuntu 21.04 as the example for the tutorial.


Advertisement


Comments and Conclusion

In the tutorial, you have learned how to install VirtualBox directly from the source repository to receive the latest updates and features in the future, along with a basic example of creating a VM using VirtualBox.

Overall, out of the many virtual machine software on the market, VirtualBox is one of the top players supplying an excellent selection of host and client combinations such as Windows from XP onwards, any Linux level 2.4 or better, Windows NT, Server 2003, Solaris, OpenSolaris, and even OpenBSD Unix.

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x