Install VirtualBox in Ubuntu 21.04/20.04/18.04

how to install virtualbox on Ubuntu

This tutorial is all focused to allow users installing VirtualBox latest version on Ubuntu Linux variants like 18.04 or 20.04 or 21.04 easily.

VirtualBox is a widely known and open-source tool offered by Oracle. It’s a cross platform virtualization application that can be installed on any system that allows users to run a number of guest operating systems on single machine over a virtual system.

Means, with the usage of VirtualBox on your system, you can easily install many operating systems and can run them simultaneously which can be helpful to develop, demonstrate, deploy and test applications on a single machine. Here includes more other features and benefits of using VirtualBox.

Easy to use: The VirtualBox is very lightweight and easy to install application. So the installation and its usage is quite simple. Still it offers a very powerful solution for users to virtualize their system easily.
Powerful: The app is powerful enough and supports Intel and AMD hardware, that allows to have fast execution and makes use of chip-level virtualization support. With the help of this application, a user can setup up to 32 vCPUs and have a wide range of storage controllers as well as asynchronous input and output virtual disk.
Control resources effectively: The VirtualBox allows users to control their resources more easily and efficiently. Means, the CPU execution, network I/O, disk read and write and other host resources can easily be throttled or capped as per the requirements. Even if the hackers manage to access your virtual machine, they won’t be able to access more than set resources.
Wide community support: Since the VirtualBox is being used on a very large scale and the app is available free for personal use, obviously if you need any kind of help, you can check out its official forum to search content for help.

How to install VirtualBox On Ubuntu 18.04, 20.04 and 21.04?

Since the virtualization system offered by Oracle is available for cross platforms, even Ubuntu users can install the app and take its benefits. In order to install VirtualBox in Ubuntu variants, there’s a number of approaches that can be helpful. Let’s discuss each of the approaches here.

Approach 1: Install VirtualBox using Software Center

For Ubuntu users, there’s an inbuilt GUI tool available inside called Software Center that offers the easiest way to install any software package including VirtualBox. Just open the app, and search for ‘Virtualbox’ in its search field:

Virtualbox in software center ubuntu

In the search results displayed, hover your cursor over VirtualBox and and click over it to open another window. There you can see a button Install. So, just hit the button, and the application will be installed on your Ubuntu Linux.

install virtualbox in ubuntu using software center

Alternatively, the installation can also be accomplished using Terminal in Ubuntu. Since the Software Center uses the default Ubuntu repository, installing the app through command line is also easily possible. Just run the command below, and VirtualBox will be installed using default repository.

sudo apt install virtualbox

Once the installation is complete, you are ready now to use the app for your purposes.

Important Note

As noticed in most of the cases, installing applications from default Ubuntu repository may install VirtualBox’s older version, means, you would be unable to install the latest features offered by the app. To do so, we recommend using more other approaches below.

Approach 2: Install VirtualBox using Official DEB file

The approach 1 is quite easy, however it has some limitations when it comes to latest version. And in order to sort out this issue, the other method to install VirtualBox using official .deb file can be helpful. The Oracle offers a ready to use binary files for its VB releases, and one can easily download it for Ubuntu and other Linux distributions as well.

Just visit Official VirtualBox Page Here and download the latest version of .deb file appropriate for your Ubuntu version, and install the DEB package using APT Command in terminal.

sudo apt install ./virtualbox-6.1_6.1.22-144080_Ubuntu_bionic_amd64.deb

It will take some time to complete installation, and you would be ready to use the latest version of VirtualBox on Ubuntu. But, the installed app through DEB package never gets updated automatically to newer releases. Means, if ever a newer version arrives, you would need to remove the older version and install the newer DEB package once again. If you want to avoid this situation, the other approach can be useful.

Approach 3: Install VirtualBox using Oracle’s repository

Although, this method can be a bit complicated for some users, still it can be helpful to avoid the need to update installed VirtualBox manually in above discussed approaches. In order to do so, you need to add Oracle VirtualBox’s repository to list of repositories in Ubuntu. Also, you may require to add GPG key to make the system trust the newly added repo.

So, the very first step is to add the key for repository, and this can be done by running below command in Terminal.

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

The next step is to add the Oracle VirtualBox repo to the list of repositories on your machine.

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

Finally, it requires to update the list of packages available through added repositories on Ubuntu and install VirtualBox. This can easily be done by running commands here.

sudo apt update
sudo apt install virtualbox-6.1
Important Note

If you are not known what latest version is available in current scenario, just run “sudo apt install virtualbox-” and press tab button on keyboard to see the suggestions regarding available versions. Based on what version you need, you can type its version details completely.

install virutal box with suggestions

So, We hope you have successfully installed the app on your Ubuntu Linux platform now. However, if you ever need to uninstall the VirtualBox app from Ubuntu, you can run the following command in terminal:

sudo apt remove virtualbox virtualbox-*

You should be aware that removing the app itself with above command will not remove the virtual machines and its associated files with operating systems. Even it’s a good thing at all to keep such files safe for your use later if required.


VirtualBox is a free and open source app offered by Oracle that is available for cross platforms. We have covered various approaches here to install the app on Ubuntu, and the easiest way we discussed to install it through Software Center. However, the other two approaches also have their own advantages. Do share this tutorial with your friends. If you have any question, you can click to Visit Our Discussion Board.