VirtualBox is a free, open-source, and cross-platform software that allows you to create, run and manage virtual machines on your system. VirtualBox was originally developed by Innotek GmbH and released in 2007. The company was later acquired by Sun Microsystems. With Oracle VM VirtualBox, you can create one or more VMs on a single physical server. Virtual machines are computers that use the hardware components of the host computer, each running its own operating system. VB supports the installation of MS Windows, Linux, BDS and MS-DOS on the installed VMs.

In this article, we will explain how to install VirtualBox on your Ubuntu system using the user interface and command line.

This Tutorial is compatible with all Ubuntu versions between Ubuntu 18.04 and Ubuntu 22.04

Installing VirtualBox Through Ubuntu Software Manager

For a person who does not want to open the Command Line much, installing a software present in the Ubuntu repository through the UI is very simple. On your Ubuntu desktop Activities toolbar, click the Ubuntu Software icon.

<img alt="Ubuntu Software Center" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/05/echo/ubuntu-software-center-icon.png" ezimgfmt="rs rscb10 src ng ngcb10" height="60" src="data:image/svg xml,” width=”62″>

The Ubuntu Software manager will open in the following view:

How to Install VirtualBox on Ubuntu 22.04 LTS Desktop linux shell ubuntu

Please click the search icon and enter VirtualBox in the search bar. The search results will list the VirtualBox entry as follows:

<img alt="Search for VirtualBox" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/05/echo/word-image-32.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="337" loading="lazy" src="data:image/svg xml,” width=”607″>

Click the VirtualBox entry from the search results. The following dialog will appear:

<img alt="VirtualBox Application Details" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/05/echo/word-image-33.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="407" loading="lazy" src="data:image/svg xml,” width=”642″>

Then, click the Install button to begin the installation process. The following authentication dialog will display for you to provide the authentication details for a sudo user as only an authorized user can install software on Ubuntu.

<img alt="Authenticate yourself as admin" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/05/echo/word-image-34.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="256" loading="lazy" src="data:image/svg xml,” width=”390″>

Enter your password and click the Authenticate button. After that, the installation process will begin, displaying a progress bar as follows.

<img alt="Installing VirtualBox" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/05/echo/word-image-35.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="387" loading="lazy" src="data:image/svg xml,” width=”608″>

VirtualBox will then be installed to your system and you will get the following message after a successful installation:

<img alt="Launch VirtualBox" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/05/echo/word-image-36.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="222" loading="lazy" src="data:image/svg xml,” width=”680″>

Through the above dialog, you can choose to directly launch VirtualBox and even Remove is immediately for whatever reason.

You can launch VirtualBox any time you want by entering ‘VirtualBox’ in Ubuntu Dash or access it from the Applications list.

<img alt="VirtualBox Icon" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/05/echo/word-image-37.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="208" loading="lazy" src="data:image/svg xml,” width=”364″>

VirtualBox will open in the following view; you can create and manage virtual machines through this tool:

<img alt="VirtualBox installed" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/05/echo/word-image-38.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="281" loading="lazy" src="data:image/svg xml,” width=”672″>

Uninstall

You can uninstall VirtualBox through the Ubuntu Software manager by first searching for it through the Search button and then clicking the Remove button from the following view:

<img alt="Uninstall VirtualBox" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/05/echo/word-image-39.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="412" loading="lazy" src="data:image/svg xml,” width=”662″>

A dialog will ask you if you are sure about removing the software from your system. Please enter the Remove button to uninstall VirtualBox. An authentication dialog will display for you to provide the authentication details for a sudo user as only an authorized user can install a software on Ubuntu. Enter your password and click the Authenticate button. After that, the uninstall process will begin, removing VirtualBox from your system.

<img alt="Software removed" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/05/echo/word-image-40.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="184" loading="lazy" src="data:image/svg xml,” width=”695″>

Installing VirtualBox Through the Command line

A Terminal-savvy person can choose to install VirtualBox through the command line as follows:

In order to install the latest VirtualBox, you need to have the Multiverse repository enabled on your system. By default this repository is disabled. Open your Ubuntu Terminal either through system Dash or the Ctrl Alt D shortcut. Then enter the following command as root in order to enable the repository and also update your system’s repository index with that on the internet:

$ sudo add-apt-repository multiverse && sudo apt-get update

<img alt="Add Multiverse repository" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/05/echo/word-image-41.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="299" loading="lazy" src="data:image/svg xml,” width=”590″>

You may be asked to provide the password for root after which the repository will be enabled on your system.

Now, enter the following command to install VirtualBox:

$ sudo apt install virtualbox

<img alt="Install VirtualBox" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/05/echo/word-image-42.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="237" loading="lazy" src="data:image/svg xml,” width=”579″>

The system will prompt you with a Y/n option in order to begin the installation procedure. Please enter Y and hit Enter to begin. VirtualBox will then be installed on your system.

You can launch VirtualBox directly through the Terminal by entering the following command:

$ virtualbox

<img alt="Run VirtualBox" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/05/echo/word-image-43.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="23" loading="lazy" src="data:image/svg xml,” width=”235″>

Exit the Terminal by entering the exit command:

$ exit

Uninstall

In order to uninstall VirtualBox from your system without removing any configurations you might have made, enter the following command as sudo:

$ sudo apt remove virtualbox

<img alt="Uninstall trough CMD line" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/05/echo/word-image-44.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="241" loading="lazy" src="data:image/svg xml,” width=”677″>

The system will prompt you with a Y/n option in order to begin the uninstall procedure. Please enter Y and hit Enter to begin. VirtualBox will then be removed from your system.

If you have made any configurations, such as installing an extension package, you can remove VirtualBox and all those by using the following command:

$ sudo apt purge virtualbox

Install the Extension Package

You may also wish to install some additional features for your VirtualBox. An extension package can be installed and then configured in your VirtualBox for this purpose.

Enter the following command as sudo in order to install the Extension Package:

$ sudo apt install virtualbox-ext-pack

The following configuration message will appear, presenting the VirtualBox terms of the license:

<img alt="Install VirtualBox Extension Pack" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/05/echo/word-image-45.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="392" loading="lazy" src="data:image/svg xml,” width=”637″>

Enter Ok and then select Yes from the following view if you agree to the terms:

<img alt="Configuring virtualbox-ext-pack" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/05/echo/word-image-46.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="291" loading="lazy" src="data:image/svg xml,” width=”617″>

No re-open the VirtualBox either through the command line or the UI.

Select Preferences from the File menu and then select the Extensions option from the left panel of the following Preferences view:

<img alt="VirtualBox Extensions" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/05/echo/word-image-47.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="324" loading="lazy" src="data:image/svg xml,” width=”468″>

You will see the Oracle VM VirtualBox Extension enabled on your VirtualBox. You can add and remove extension packages through this view by clicking the add and remove buttons.

If you want to uninstall the extension package through the command line, please enter the following command:

$ sudo apt ins virtualbox-ext-pack

<img alt="Remove Extension Pack" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/05/echo/word-image-48.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="164" loading="lazy" src="data:image/svg xml,” width=”597″>

The system will prompt you with a Y/n option in order to begin the uninstall procedure. Please enter Y and hit Enter to begin. VirtualBox extension package will then be removed from your system.

By following the steps described in this article, you can learn to install and uninstall the latest version of VirtualBox on your Ubuntu system, both through the graphical user interface and the command line. You can also add further extension packages and use them with your VirtualBox installation with the help of this article.