How To Install Virtualbox on Ubuntu 18.04
Posted on July 7, 2021 (Last modified on July 14, 2022) • 3 min read • 559 wordsIn this tutorial we learn how to install VirtualBox on Ubuntu 18.04. We will learn the installation of VirtualBox package from Ubuntu repository and from Oracle repository
How To Install Virtualbox on Ubuntu 18.04
In this tutorial we learn how to install Virtualbox on Ubuntu 18.04.
Virtualbox is a virtualization for x86 and AMD64/Intel64. Initially created by Innotek which was acquired by SUN Microsystem in 2008. In 2010, SUN Microsystem was acquired by Oracle.
Some features of Virtualbox including:
There are two source of installing Virtualbox on Ubuntu 18.04.
We will learn how to install Virtualbox from each repository above. You just have to follow one of method described below
Before installing Oracle Virtualbox from Ubuntu repository, let’s update our systems’ apt database using the command below.
sudo apt-get update
```bash
After updating our systems apt database we can install virtualbox using the command below.
```bash
sudo apt install virtualbox virtualbox-ext-pack
Press y
to continue the installation process.
We just finished installing Virtualbox from Ubuntu repository.
In the next section we will learn how to install Virtualbox from Oracle repository.
In this section we learn how to install Virtualbox from Oracle repository.
First, we need to add Virtualbox GPG key. This will be used by apt to verify whether the package we download is a correct package which was created by Virtualbox developers.
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
```bash
### Create Virtualbox Repository Configuration {#h-create-virtualbox-repository-configuration}
After adding Virtualbox GPG key, now we will create new file `/etc/apt/sources.list.d/virtualbox.list` using the command below.
```bash
echo "deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian bionic contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list >> /dev/null
GPG key and repository configuration created. Now it’s time to update our apt database / metadata using the command below.
sudo apt-get update
```bash
### Install Virtualbox on Ubuntu 18.04 {#h-install-virtualbox-on-ubuntu-18-04}
Everything is ready, it's time to install Virtualbox on Ubuntu 18.04 using the command below.
```bash
sudo apt-get install virtualbox
Press y
to continue the installation process.
VirtualBox Extension Pack provides several useful functionalities for guest machines such as virtual USB 2.0 and 3.0, support for RDP, images encryption and more.
First let’s download the VirtualBox Extension pack file using the command below.
wget https://download.virtualbox.org/virtualbox/6.1.22/Oracle_VM_VirtualBox_Extension_Pack-6.1.22.vbox-extpack
```bash
Install VirtualBox Extension Pack using the command below.
```bash
sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.1.22.vbox-extpack
Do you agree to these license terms and conditions (y/n)?
```bash
Press `y` to continue the installation process
```bash
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Successfully installed "Oracle VM VirtualBox Extension Pack".
Oracle VM VirtualBox Extension successfully installed.
To start VirtualBox, you can type virtualbox
from terminal.
Alternatively you can click on VirtualBox icon on Activities -> Virtualbox
To learn more about VirtualBox, you can read VirtualBox Documentation.
In this tutorial we learn how to install VirtualBox from Ubuntu Repository and Oracle Repository.
The VirtualBox version from Oracle Repository should provide you with the latest version of Oracle VirtualBox.
When installing Oracle VirtualBox from Oracle repository, you have to manually install Extension pack by downloading the extension pack and run vboxmanage
command.