Installing VirtualBox in Ubuntu

VirtualBox is an open-source virtualization application developed by Oracle which lets you emulate multiple Operating Systems,it boasts high performance and functionality,and is suitable for both home and enterprise use.

Method 1: Installing from Ubuntu’s directories(Simplest Method)


Step 1:

Open the terminal by pressing Ctrl+Alt+t and enter the following command :

sudo apt-get update
sudo apt-get install virtualbox

Step 2(Optional): Installing the Extension pack

The extension pack adds extra features such as encryption,USB 2.0 and 3.0 support.To install,enter the following :

sudo apt-get install virtualbox-ext-pack

Method 2: Installing through .deb package


Step 1: Download the .deb package from Oracle’s website or through this link.

Step 2: Double click on the .deb package to install.

Alternatively,you can also install a .deb file by opening a terminal in the Downloads folder and typing:

sudo dpkg -i package_file.deb

To uninstall a .deb file, type:

sudo apt-get remove package_name

Note: Replace package_file with the name of your .deb file

Method 3:Installing from Oracle’s repositories


This repository is updated more frequently and is advised for users requiring the latest patches. The process is in-depth but installs the latest version of VirtualBox.

Step 1: Installing Dependencies

The software-properties-common package lets you add the VirtualBox repository in Ubuntu

sudo apt-get install software–properties–common

Step 2: Installing GPG keys

GPG keys allows you to verify and communicate with different repositories.To download and install the GPG keys for VirtualBox,enter the commands:

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

Step 3: Adding the repository to Ubuntu

To add the VirtualBox repository, enter the command :

sudo add-apt-repository "deb http://download.virtualbox.org/virtualbox/debian bionic contrib"

Step 4:Installing the Latest Version of VirtualBox

To install VirtualBox on Ubuntu,use the commands:

sudo apt-get update
sudo apt-get install virtualbox-6.1

Note:Replace the VirtualBox version with your version.For example,use the following command for VirtualBox 5.8:

sudo apt-get install virtualbox-5.8

Step 5:Installing the Extension pack

To install,use the commands:

wget https://download.virtualbox.org/virtualbox/6.0.8/Oracle_VM_VirtualBox_Extension_Pack-6.0.8.vbox-extpack
sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.0.8.vbox-extpack

Press Y when asked for confirmation,the Extension pack will be installed.

Launching VirtualBox


Launch it by entering virtualbox in the terminal or by clicking on its icon in the Applications menu.
After VirtualBox launches,use the New button to create a VM. Select the OS and version of your choice in the dialog, then click Next.The dialog offers several customization options to allocate memory, hard drive, and other resources to the VM.Use default options if you are unsure about customizing this.
After you complete the above processes, a new VM is available in the left column. Select it, and click the green arrow Start button. A new window will open and boot up the virtual machine.


P.S. - This is a simple tutorial targeted towards beginners.

1 Like

Thanks a ton for this contribution. You’re awesome!

1 Like

Thanks for the support. Much appreciated !!