VirtualBox is a free and open-source hypervisor for x86 computers that allows users to run multiple virtual machines (VMs) on one physical machine. Users can run each of these VMs with its own operating system. Virtual machines can be "powered on" and "suspended" as required. This allows users to switch between different operating systems or versions of the same operating system. VirtualBox supports a variety of guest operating systems, such as Windows, Linux, macOS, and Solaris, and allows for different configurations. This includes configuring virtual networks and shared folders between the host and guest. The main use for VirtualBox is for testing and development, but it can also be used for personal use or in a business environment to run legacy software on new hardware or in an isolated environment.

VirtualBox Installation

Run these commands for installation on Ubuntu 22.04;

sudo apt update

sudo apt install virtualbox

What is VirtualBox Extension Package? How to install in 22.04

VirtualBox Extension Pack is an extension that is used to expand the features of the VirtualBox software. This extension adds additional features such as support for USB 2.0 and 3.0, RDP (Remote Desktop Protocol) support, PCI passthrough, and disk write acceleration. It also provides features for creating Host-Only and Internal networks between virtual machines. The extension can be downloaded from the official VirtualBox website and installation is straightforward.

Newbies in *nix environment learn the hard way that they need to add the Multiverse repository, which is not mentioned much on the Internet, to install this package.

The "multiverse" is a package repository for Ubuntu and Debian Linux distributions. This repository contains software that is not included in the main Ubuntu repositories because of licensing issues but are still supported for Ubuntu. For example, some software can only be legally used on a single computer, or have limited use conditions like software with a license agreement. This software can use the "multiverse" repository.

sudo add-apt-repository multiverse 

Then we can install the VirtualBox Extension Package;

sudo apt install virtualbox-ext-pack

During installation, you can accept the License terms by ticking OK and YES respectively. Use your TAB key to mark YES.

How Do I Remove VirtualBox from Ubuntu?

You can start the uninstallation process with the following commands. If you have VirtualBox installed, you can also delete it with the second command. You can confirm the deletion process by typing Y and entering the questions.

sudo apt purge virtualbox

sudo apt purge virtualbox-ext-pack

That is all.