Install VirtualBox and its extension on Ubuntu
Step 1: Update Ubuntu
Before installing VirtualBox, run the commands below to update the Ubuntu server.
sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove
Step 2: Install Required Linux Headers
Now that your system is updated, run the commands below to install required Ubuntu linux headers.
sudo apt-get -y install gcc make linux-headers-$(uname -r) dkms
Step 3: Add VirtualBox Repository and key
After installing the required package above, run the commands below to install VirtualBox repository key.
Next run the commands below to add VirtualBox repository to your system.
sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" >> /etc/apt/sources.list'
Step 4: Install VirtualBox
After adding the repository and key, run the commands below to install VirtualBox . At the time of this writing the latest version of the software was 5.2. If there are newer versions available, please replace the 2 below with the current latest.
To verify if VirtualBox is installed, run the commands below.
VBoxManage -v
Step 5: Install VirtualBox Extension Pack
Everytime you install VirtualBox make sure to install the extension pack as well. The pack enables VRDP (Virtual Remote Desktop Protocol) and many other enhancements.
To install it, run the commands below
Agree to the terms and install.
Run the commands below to view the extension pack installed.
VBoxManage list extpacks
The results should look like the one below:
Last updated
Was this helpful?