VirtualBox is an open source and free virtualization software which allows you to run multiple operating systems simultaneously. It’s also a cross-platform software which is available for Linux, Windows, and MacOS etc. The VirtualBox package is also available in Ubuntu repositories but it always does not provides the latest version. If you would like to have the latest version of VirtualBox then the best way to install through Oracle repositories. In this tutorial we are going to show you how to install VirtualBox on Ubuntu 18.04 using different two methods.
Before you go ahead with tutorial, Make sure that you are logged in as a non-root user with sudo privileges.
Install VirtualBox from Oracle Repositories
This is the first method to install VirtualBox and at the time of writing this article, the latest version of VirtualBox is 6.0.8. You should check the latest version of VirtualBox at VirtualBox Download page.
Perform the below steps to install VirtualBox from the Oracle repositories on your Ubuntu system:
At first, import GPG keys of the Oracle VirtualBox repository to your system using wget 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 -
On successfully importing both commands will show
OK as output.
Next, add the VirtualBox repository using the
add-apt-repository command as shown below:
sudo add-apt-repository "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib"
Note : If you get an error message saying
add-apt-repository command not found then you need to install the
Once the repository is enabled, you have to update the apt package list by typing:
sudo apt update
At last, install VirtualBox using below command:
sudo apt install virtualbox-6.0
Install VirtualBox Extension Pack
VirtualBox Extension Pack should install to get several useful features for guest machines. It will provides features such as virtual USB 2.0 and 3.0 devices, images encryption and support for RDP etc. Run the below command to download extension:
Once the download completed, import the extension pack using the following command:
sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.0.8.vbox-extpack
It will show you Oracle license and ask to accept their terms and conditions.
Output Do you agree to these license terms and conditions (y/n)?
y to continue, Once the installation is completed you will see the following output:
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Successfully installed "Oracle VM VirtualBox Extension Pack".
Install VirtualBox from Ubuntu repositories
This is the second method to install VirtualBox from Ubuntu repositories. This method is very simple and easy to install VirtualBox.
Update the apt package manager index by typing:
sudo apt update
To install VirtualBox and VirtualBox Extension Pack run below command:
sudo apt install virtualbox virtualbox-ext-pack
Now that VirtualBox is installed on your Ubuntu system and ready to use. You can launch using terminal by typing
virtualbox or you can by clicking on VirtualBox icon from (
Activities -> Oracle VM VirtualBox).
You will show window as following on start up of VirtualBox.
You have learned how to install VirtualBox on your Ubuntu 18.04 machine. You also can install your favorite another operating system on guest machine. If you would like to get more details about VirtualBox visit the official VirtualBox documentation page.
If you have any question or suggestion, please leave comment below.