is a cross-platform open source virtualization software that allows you to run multiple guest operating systems (virtual machines) at the same time.
In this tutorial, we are going to show you two different methods of installing VirtualBox on your Ubuntu 18.04 computer. The first method describes the steps required to install VirtualBox 6.0 from the Oracle repositories, while the second shows you how to install the latest version of VirtualBox from the official Ubuntu repositories.
The VirtualBox package available in the Ubuntu Multiverse Repository may not always be the latest version. If you always want to have the latest version of VirtualBox, it is advisable to install the VirtualBox from the Oracle repositories.
The same instructions apply to Ubuntu 16.04 and all Ubuntu-based distributions, including Linux Mint and Elementary OS.
Before proceeding with this tutorial, make sure that you are logged in as a user with sudo permissions.
Install VirtualBox from Oracle Repositories
At the time of this writing, the latest version of VirtualBox is version 6.0. Before proceeding with the next steps, you should have the VirtualBox download page
to see if a newer version is available.
To install VirtualBox from the Oracle repositories on your Ubuntu system, do the following:
Start by importing the Oracle VirtualBox repository’s GPG keys into your system using the following 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 -
Both commands should be issued
OKThis means that the keys have been imported successfully and packages from this repository are trusted.
Next add the VirtualBox APT repository with the. added
add-apt-repositoryCommand as shown below:
sudo add-apt-repository "deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib"
$(lsb_release -cs)prints the Ubuntu code name. For example, if you have Ubuntu version 18.04, the command will be printed
If you get an error message that says
add-apt-repository command not foundthen you have to install that
Once the VirtualBox repository is enabled, update the apt package list and install the latest version of VirtualBox 6.0 using:
sudo apt update
sudo apt install virtualbox-6.0
Install the VirtualBox expansion pack
The VirtualBox Extension Pack provides several useful features for guest machines such as USB 2.0 and 3.0 virtual devices, support for RDP, image encryption, and more.
Download the extension pack file by typing:
When the download is complete, import the expansion pack using the following command:
sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.0.0.vbox-extpack
You will be presented with the Oracle license and asked to accept its terms.
Do you agree to these license terms and conditions (y/n)?
y and hit
Enter. Once the installation is complete, 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
Installing VirtualBox from Ubuntu repositories is a pretty straightforward process. Just run the following commands:
sudo apt update
sudo apt install virtualbox virtualbox-ext-pack
Now that VirtualBox is installed on your Ubuntu system, you can either start it from the command line by typing
virtualbox or by clicking the VirtualBox icon (
Activities -> Oracle VM VirtualBox).
The first time you start VirtualBox you should see a window like the following:
You learned how to install VirtualBox on your Ubuntu 18.04 computer. You are now ready to install your first Windows or Linux guest computer. For more information on VirtualBox, see the official VirtualBox documentation
If you want to manage your virtual machines from the command line, check out this article on how to install Vagrant on Ubuntu 18.04.
If you have any questions please leave a comment below.