Ubuntu

How to Install and Setup Virtualbox on Ubuntu 22.04

Want to run different operating systems on Ubuntu 22.04? Try out VirtualBox. The VirtualBox is a free and open source virtual machine that allows you the platform to run various operating systems with ease making it quite comfortable for you to switch to another OS without restart.

In this tutorial, we will guide you how you can install and set up VirtualBox on Ubuntu 22.04.

Install and setup VirtualBox on Ubuntu 22.04

The VirtualBox repository is already included in Ubuntu 22.04 repository, making the installation pretty straightforward for the users.

To begin the installation, first update your Ubuntu 22.04 packages and dependencies using the following commands:

$ sudo apt update

Then execute the following installation command to install VirtualBox on Ubuntu 22.04:

$ sudo apt install VirtualBox

Once the VirtualBox installation is completed, you can then run it using the “virtualbox” command:

Setup VirtualBox on Ubuntu 22.04

Now, the next thing is how to set up VirtualBox on Ubuntu 22.04 to install another operating system. First, you will need to install extension packs for VirtualBox as this will enable you to use other Virtualbox functionalities like support for USB, disk encryption and much more.

To install the packs, first download them using the following command:

$ wget https://download.virtualbox.org/virtualbox/6.1.32/Oracle_VM_VirtualBox_Extension_Pack-6.1.32.vbox-extpack

Then use the below-given command to install the extension packs on Ubuntu:

$ sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.1.32.vbox-extpack

Go to the “File” tab in VirtualBox and select the “Preferences” option:

There, in the “Extensions” option, you will find the downloaded extensions packs.

Now, the next step is to download a fresh copy of the operating system in .iso format. In our case, we downloaded Linux Lite. Once the download is completed, you can then open the VirtualBox and follow the below steps.

Step 1: Click on the “New” button:

Step 2: Provide a name for your operating system, choose the operating system type and select the version:

In our case we pick to install a Linux operating system and then click on the “Next” button:

Step 3: Choose your desired Memory size and then click on the “Next” button:

Step 4: Click on the “Create” button by going with the default option of creating a virtual hard disk as shown below:

Step 5: Choose VDI format and click on the “Next” button:

Step 6: Select Dynamically allocated option:

Step 7: Choose your desired storage and then click on the “Create” button.

Step 8: Once the above steps are done, click on the “Start” button:

Step 9: Choose the .iso file of the operating system you want to host on Ubuntu by going into the folder where it is placed using the icon shown in the below image:

Step 10: Click on the “Add” button to add the iso file.

Step 11: After adding the file, click on the “Start” button:

This will create an image with the name Linux Light. Click on the “Start” button to begin installing the operating system on VirtualBox.

In case, if you need further help you can get guidance from our published article which installs Raspberry Pi OS on VirtualBox. You can follow the article guidelines to easily install another OS.

Removing VirtualBox from Ubuntu 22.04

To remove VirtualBox from Ubuntu 22.04, run the following command.

$ sudo apt remove --autoremove VirtualBox

Conclusion

Running multiple operating systems on Ubuntu 22.04 has become pretty simple. Thanks to VirtualBox. It allows the user to install the operating system through an .iso file and once the installation is completed through above steps, you can then enjoy experiencing multiple desktop environments on Ubuntu without having to restart your system.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.