Installing VirtualBox 5.2 on Ubuntu 17.04 | 17.10

VirtualBox recently reached a new major milestone.. version 5.2. This release brings lots of enhancements and changes, including unattended guest installation, VM export to Oracle Cloud, added experimental audio support for video recording and many more.

This brief tutorial shows students and new users how to install VirtualBox 5.2 on Ubuntu 17.04 | 17.10 Desktop / Server. If you’re reading this post then you probably know a thing or two about VirtualBox.

If you don’t, it’s a cross-platform virtualization software that allows you to run guest operating system inside a windows of the host computer. The guest machine can Windows, Linux or Mac operating systems.

VirtualBox is a powerful application that I’d recommend every IT student to download and install to create virtual labs. These labs can be a self-contained environments where you can test different applications and settings.

To install VirtualBox on Ubuntu servers, follow the steps below

Step 1: Update Ubuntu

Before installing VirtualBox, run the commands below to update 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.

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 -

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 5.1. At the time of this writing the latest version of the software was 5.1. If there are newer versions available, please replace the one below with the current latest.

sudo apt-get update
sudo apt-get install virtualbox-5.2

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

curl -O http://download.virtualbox.org/virtualbox/5.2.0/Oracle_VM_VirtualBox_Extension_Pack-5.2.0-118431.vbox-extpack
sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-5.2.0-118431.vbox-extpack

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:

Successfully installed "Oracle VM VirtualBox Extension Pack".
richard@ubuntu1704:~$ VBoxManage list extpacks
Extension Packs: 1
Pack no. 0:   Oracle VM VirtualBox Extension Pack
Version:      5.2.0
Revision:     118431
Edition:
Description:  USB 2.0 and USB 3.0 Host Controller, Host Webcam, VirtualBox RDP, PXE ROM, Disk Encryption, NVMe.
VRDE Module:  VBoxVRDP
Usable:       true
Why unusable:

This is how to install VirtualBox on Ubuntu servers and deskop

virtualbox installing ubuntu

Enjoy!

In our next post, we’ll show you how to create new guest machines from the command line in VirtualBox. Until then, please stay tuned.

You may also like the post below:

24 Replies to “Installing VirtualBox 5.2 on Ubuntu 17.04 | 17.10

  1. Can’t install VirtualBox 5.2 on Ubuntu 17.10:
    ————————————————————–
    sudo apt-get install virtualbox-5.2
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package virtualbox-5.2
    E: Couldn’t find any package by glob ‘virtualbox-5.2’
    E: Couldn’t find any package by regex ‘virtualbox-5.2’

    1. Thank you for your contribution Richard!
      These days Robot are everywhere but I can easily say this article is written by REAL human.
      I’d like your below 2x one liner:
      “sudo apt-get -y install gcc make linux-headers-$(uname -r) dkms”
      “sudo sh -c ‘echo “deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib” >> /etc/apt/sources.list’ “

  2. I did everything according to the directions above and I still wasn’t able to access usb.

    Any idea on what should I do next?

  3. Seems you are too early with 17.10.
    At step 4 (sudo apt update): “E: The repository ‘http://download.virtualbox.org/virtualbox/debian artful Release’ does not have a Release file. …”

    Does not work.

    1. They have yet to publish Virtual Box for 17.10 . I don’t know what is the delay.
      There’s a problem with their latest extension pack , probably they’re busying with the bug fix for that.

  4. I could not install from the command line either.
    I followed instructions all the way down to “sudo apt-get install virtualbox-5.2” before it failed.

    I then downloaded the .deb file and double clicked on it, letting the installer open it up. I chose “install” and it successfully installed.
    However, it did not install a launcher for it, so I have to type “virtualbox” in the terminal to launch.
    I am going to research how to make a destop launcher next, but for now it works.
    It does allow to create a desktop shortcut to guest operating system though.

    I am running i7 32 gb ram, Ubuntu Mate 17.10

  5. Sadly I don’t think it works on all 17.10s. Mine has a new install of Version 5.2.2 r119230 (Qt5.9.1) with matching extensions.Users are in vboxusers. USB is identified in Ubuntu (lsusb) but nothing seen in the VB window (Devices) and thus also not in XP which is the client.
    Methinks there is a fundamental and as yet not fixed issue with VB and 17.10. I have used VB for years over many versions of Ubuntu and VB and this is unusual.

    1. Hi
      Need to add your Linux user to VBox group in order to keep USB devices available into your VBOX machine :
      1 – sudo usermod -G vboxusers -a $USER
      2 – Then restart your linux session / then plug your usb device
      3 – From VBOx manager (application) Configure your VBox machine ==> USB ==> “Add Filter From Device” button (Second button from top with green plus symbol).
      4 – Start your Vbox machine ==> you’ll find the usb device connected to your slave machine.

  6. To add to my last: running Virtualbox under SUDO does allow it to detect USB and thus the client to use the devices. So the problem seems to be that being a member of VBOXUSERS is not sufficient to allow usage.

  7. I got a problem when i run this commend and am not able to run any virtual os please fix this bug if you know how to
    *Thanks in advance
    VBoxManage -v
    WARNING: The vboxdrv kernel module is not loaded. Either there is no module
    available for the current kernel (4.13.0-36-generic) or it failed to
    load. Please recompile the kernel module and install it by

    sudo /sbin/vboxconfig

    You will not be able to start VMs until this problem is fixed.
    5.2.6r120293

  8. I had previously tried to install virtualbox before reading this guide and had a problem with prerequiites and unmet dependies which has now been fixed however when I try a new install I get
    sudo apt install ./virtualbox-5.2_5.2.8-121009_Ubuntu_zesty_amd64.deb
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Note, selecting ‘virtualbox-5.2’ instead of ‘./virtualbox-5.2_5.2.8-121009_Ubuntu_zesty_amd64.deb’
    virtualbox-5.2 is already the newest version (5.2.8-121009~Ubuntu~zesty).
    0 to upgrade, 0 to newly install, 0 to remove and 7 not to upgrade.
    trev@nvme01:~/Downloads$ VboxManage -v
    VboxManage: command not found
    When I try and remove or purge I get
    sudo apt-get purge virtualbox
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Package ‘virtualbox’ is not installed, so not removed
    0 to upgrade, 0 to newly install, 0 to remove and 7 not to upgrade.

  9. Worked for me ONLY after installing ext pack and setting USB to 3.0

    #!/bin/bash

    VBoxManage modifyvm “macOS 10.14 Mojave” –cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
    VBoxManage setextradata “macOS 10.14 Mojave” “VBoxInternal/Devices/efi/0/Config/DmiSystemProduct” “iMac11,3”
    VBoxManage setextradata “macOS 10.14 Mojave” “VBoxInternal/Devices/efi/0/Config/DmiSystemVersion” “1.0”
    VBoxManage setextradata “macOS 10.14 Mojave” “VBoxInternal/Devices/efi/0/Config/DmiBoardProduct” “Iloveapple”
    VBoxManage setextradata “macOS 10.14 Mojave” “VBoxInternal/Devices/smc/0/Config/DeviceKey” “ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc”
    VBoxManage setextradata “macOS 10.14 Mojave” “VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC” 1
    VBoxManage list extpacks

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.