Installing VirtualBox on Ubuntu 17.04

This post shows students and new users an easy way to install VirtualBox on Ubuntu 17.04 (Zesty Zapus). It’s going to be short and easy to comprehend.

For those who don’t know what VirtualBox is, it’s a free virtualization software the allows anyone to run multiple guest operating systems on a single host computer. For example, let’s assume that you have a single computer, a good one with lots of storage and RAM.

You can install VirtualBox host software on that single computer (Windows, Linux or Mac) and run additional operating systems inside the VirtualBox software. Each of the other guest operating system (Windows 10, Ubuntu Linux Mac OS) running inside of VirtualBox runs independently of each other. Each guest machine also thinks it’s the only system running on the computer.

For IT students, VirtualBox should be one of the tools they should install.

To install VirtualBox on Ubuntu, follow the steps below:

Step 1: Update Ubuntu and Add VirtualBox Repository

Before installing VirtualBox, run the commands below to update Ubuntu.

sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove

After updating the Ubuntu machine, run the commands below to add VirtualBox repository key.

wget -q -O- | sudo apt-key add -

After adding the repository key to Ubuntu, run the commands below to add VirtualBox repository to Ubuntu.

sudo sh -c 'echo "deb $(lsb_release -sc) contrib" >> /etc/apt/sources.list'

Now that you’ve added VirtualBox’s repository key, continue below to install.

Step 2: Install VirtualBox

After adding the repository to Ubuntu, the last step is to install VirtualBox. The command to install VirtualBox on Ubuntu is shown below. However, you should replace the version number with the current (latest) version number.

At the time of this writing, the current version number is 5.1. So before you actually install the package, go to download page and confirm the latest version number.

Run the commands below to install VirtualBox version 5.1

sudo apt-get update
sudo apt-get install virtualbox-5.1

The commands above will update Ubuntu repositories and install VirtualBox.

Step 3: Installing VirtualBox Extension Pack

After installing VirtualBox software, you should immediately install the extension pack. The extension pack extends the capabilities of the virtual machines (guest).

So, go to the download page and download the pack for (All supported platforms)

Double click the extension pack after downloading to install it.

virtualbox extension pack installation

After that, VirtualBox should be ready to use and run guest operating systems.

virtualbox welcome


Removing VirtualBox from Ubuntu

If you wish to remove VirtualBox from Ubuntu, run the commands below

sudo apt-get purge virtualbox-5.1 && sudo apt-get autoremove


This post shows students and new users on how to install VirtualBox on Ubuntu. It’s a great tool to have especially if you’re IT professional. VirtualBox lets you run your own labs with separate guest operating systems without the extra cost for additional hardware.

You may also like the post below:


  1. Thanks! Got er up and running with your help!

  2. Thank you very much.

    Clear, concise, accurate and clearly written instructions.

    That was a great help.


  3. Perfect ! Thank you very much from France

  4. Elías from Costa Rica

    Thanks for the tutorial!
    Im having this issue were I cant start the virtual machine the installation goes fine until I get the following error message:

    There were problems setting up VirtualBox. To re-start the setup process, run /sbin/vboxconfig as root.

    I proceed to run the setup process and then I get another error: failed: modprobe vboxdrv failed. Please use ‘dmesg’ to find out why.

    And prompts me to run the setup process again. I cant start any virtual machine until this is fixed. My Os is Ubuntu 17.04 (zetsy)

    Thanks for your help

  5. Hi. I got the error: “sh: 1: lsb_release: not found” when trying to add a VirtualBox repository to the sysmtem. Any idea what could be causing that?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.