• Home
  • Ubuntu 20.04
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 20.04
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Install VirtualBox 5.2 on Ubuntu 16.04 LTS

Written by Rahul, Updated on February 4, 2019

Oracle VirtualBox 5.2.8 has been released on February 27th, 2018. Oracle VirtualBox 5.2 is the latest major release after launched by Oracle team. This version has the new feature to export VM to Oracle Cloud, Unattended guest installation, improved tools handling with more attractive icons. Oracle team also added an experimental feature for audio support for video recording. See the ChangeLog for more details.

This article helps you to install VirtualBox on Ubuntu 16.04 LTS systems.

Step 1 – Prerequsities

You must have logged in to your server using root or sudo privileged user. After login to your system update current packages of the system to the latest version.

sudo apt-get update
sudo apt-get upgrade

Step 2 – Configure Apt Repository

Let’s import the Oracle public key to your system signed the Debian packages using the following 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 -

Now, you need to add Oracle VirtualBox PPA to Ubuntu system. You can do this by running the below command on your system.

sudo add-apt-repository "deb http://download.virtualbox.org/virtualbox/debian xenial contrib"

This command will add an entry to /etc/apt/sources.list at end of the file.

Step 3 – Install Oracle VirtualBox

After completing the above steps, let’s install VirtualBox using the following commands. If you have already installed an older version of VirtualBox, Below command will update it automatically.

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

Step 4 – Launch VirtualBox

We can use dashboard shortcuts to start VirtualBox or simply run following command from a terminal.

virtualbox

virtualbox-on-ubuntu

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

50 Comments

  1. Avatar Sam Reply
    April 14, 2019 at 9:31 pm

    Great tutorial, I think there is a typo. Is the line added to your /etc/apt/sources.list should be “https” and not “http”? Thanks

  2. Avatar tom Reply
    April 11, 2019 at 7:42 pm

    just get rid of the version number

    sudo apt-get install virtualbox

  3. Avatar Munendra Singh Reply
    February 9, 2019 at 11:47 am

    [email protected]:~$ sudo apt-get install virtualbox-5.2
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    virtualbox-5.2 : Depends: libcurl3 (>= 7.16.2) but it is not installable
    Depends: libpng12-0 (>= 1.2.13-4) but it is not installable
    Depends: libvpx3 (>= 1.5.0) but it is not installable
    Recommends: libsdl-ttf2.0-0 but it is not installable
    Recommends: gcc but it is not going to be installed
    Recommends: make but it is not installable or
    build-essential but it is not installable or
    dpkg-dev but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    [email protected]:~$

  4. Avatar Fabio Santos Reply
    January 13, 2019 at 2:02 pm

    Run
    sudo gedit /etc/apt/sources.list

    then copy and past the following at last of the file and Save it, if your dist is xenial, or run lsb_release -c to see your dist

    Then add this line in your source list, and remove others dist
    deb http://download.virtualbox.org/virtualbox/debian xenial contrib

  5. Avatar ahbehnam Reply
    December 20, 2018 at 9:58 am

    Thanks very much

  6. Avatar Sunil Reply
    October 11, 2018 at 8:35 am

    worked like charm for ubuntu 16.04 on AMD 64
    thanks
    S

  7. Avatar Yogesh Reply
    August 10, 2018 at 8:02 am

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

    I can try this ,but error is not resolved, please help me.

    • Avatar CHAKI Reply
      September 18, 2018 at 8:13 am

      I have the same problem! Did you solve it?

    • Avatar Gyurme Reply
      October 12, 2018 at 10:46 am

      I had problem running virtualbox after setting up. This was because I was using older kernel version (4.15) on ubuntu. To find out kernel version run:

      uname -r

      if it shows older version, update your kernel version to 4.19

  8. Avatar ripe Reply
    July 1, 2018 at 7:34 am

    what is best way to fix issue with secure boot? since kernel module is unsigned

  9. Avatar Rohit Agarwal Reply
    April 29, 2018 at 12:08 pm

    Its very helpful, Today I posted virtualmin 5.2 on Ubuntu 18.04 in my website.

  10. Avatar fatemeh Reply
    March 15, 2018 at 7:22 am

    it gives me the error
    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’

    what should I do???

    • Rahul Rahul K. Reply
      March 15, 2018 at 10:56 am

      Which OS version are you using?

  11. Avatar AarifAbdal Reply
    March 1, 2018 at 4:25 am

    Really a good Blog…. thanx..sir

  12. Avatar dosghost Reply
    February 24, 2018 at 7:58 pm

    sudo apt-get update
    sudo apt-get install virtualbox

    works to.

  13. Avatar Fongoh Tayong Reply
    December 4, 2017 at 8:40 pm

    Thanks for the help man.

  14. Avatar maryiem Reply
    October 27, 2017 at 1:54 pm

    help pls !!!!

    Err:9 http://download.virtualbox.org/virtualbox/debian jaunty Release
    404 Not Found [IP : 193.140.13.73 80]
    Lecture des listes de paquets… Fait
    E: The repository ‘http://download.virtualbox.org/virtualbox/debian artful Release’ does not have a Release file.
    N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.

  15. Avatar DevMj Reply
    October 25, 2017 at 5:45 pm

    Nice.It helped me. Thank you

  16. Avatar Albert Reply
    September 22, 2017 at 1:08 pm

    Trying to install into Linux Mint 17.2 Rafaela, upon running sudo apt-get install virtualbox-5.1 I get “E: Couldn’t find any package by regex ‘virtualbox-5.1′”

  17. Avatar leo messi Reply
    August 26, 2017 at 2:41 pm

    thanks a lot my friend!! run very well

  18. Avatar ferdinand Reply
    August 10, 2017 at 12:47 pm

    thanks a lot for publishing this guide.

  19. Avatar Alessandro Gonçalves Reply
    July 14, 2017 at 1:25 pm

    Thank you man, your tutorial was on point. Simple and direct.

  20. Avatar Fortune Reply
    May 4, 2017 at 5:02 pm

    [email protected]:~# sudo echo “deb http://download.virtualbox.org/virtualbox/debian xenial contrib” >> /etc/apt/sources.list
    [email protected]:~# sudo apt-get update
    E: Type ‘“deb’ is not known on line 52 in source list /etc/apt/sources.list
    E: The list of sources could not be read.

  21. Avatar Paul Reply
    May 2, 2017 at 4:55 pm

    Thanks so much, finally got me going in Ubuntu 17.04.

  22. Avatar Ikhwan Reply
    April 8, 2017 at 11:41 pm

    Thanks a lot. It works in my trusty

  23. Avatar JideGuru Reply
    April 4, 2017 at 10:23 pm

    Thanks a lot

  24. Avatar Jhon Reply
    March 24, 2017 at 9:23 pm

    Thanks a lot

  25. Avatar kaleem Reply
    January 22, 2017 at 4:32 pm

    [email protected]:~$ lsb_release -c
    Codename: xenial
    [email protected]:~$ deb http://download.virtualbox.org/virtualbox/debian xenial contrib
    No command ‘deb’ found, did you mean:
    Command ‘dab’ from package ‘bsdgames’ (universe)
    Command ‘deb3’ from package ‘quilt’ (universe)
    Command ‘debi’ from package ‘devscripts’ (main)
    Command ‘derb’ from package ‘icu-devtools’ (main)
    Command ‘dub’ from package ‘dub’ (universe)
    Command ‘debc’ from package ‘devscripts’ (main)
    Command ‘xdeb’ from package ‘xdeb’ (universe)
    Command ‘dex’ from package ‘dex’ (universe)
    deb: command not found

    • Avatar anoni Reply
      January 24, 2017 at 5:43 pm

      hi insted of your commande use this one below
      sudo echo “deb http://download.virtualbox.org/virtualbox/debian xenial contrib” >> /etc/apt/sources.list
      then upadate with
      sudo apt update

      • Avatar Daniel Juncos Reply
        March 28, 2017 at 9:50 am

        Nope. Didn’t work.

        [email protected]:~$ deb http://download.virtualbox.org/virtualbox/debian xenial contrib
        No command ‘deb’ found, did you mean:
        Command ‘deb3’ from package ‘quilt’ (universe)
        Command ‘debi’ from package ‘devscripts’ (main)
        Command ‘dab’ from package ‘bsdgames’ (universe)
        Command ‘dex’ from package ‘dex’ (universe)
        Command ‘debc’ from package ‘devscripts’ (main)
        Command ‘derb’ from package ‘icu-devtools’ (main)
        Command ‘xdeb’ from package ‘xdeb’ (universe)
        Command ‘dub’ from package ‘dub’ (universe)
        deb: command not found
        [email protected]:~$ sudo echo “deb http://download.virtualbox.org/virtualbox/debian xenial contrib”
        “deb http://download.virtualbox.org/virtualbox/debian xenial contrib”
        [email protected]:~$ /etc/apt/sources.list
        -bash: /etc/apt/sources.list: Permission denied
        [email protected]:~$ lsb_release -c
        Codename: xenial
        [email protected]:~$ sudo echo “deb http://download.virtualbox.org/virtualbox/debian xenial contrib” >> /etc/apt/sources.list
        -bash: /etc/apt/sources.list: Permission denied
        [email protected]:~$

        • Rahul Rahul K. Reply
          March 28, 2017 at 2:53 pm

          Hi Denial,

          It looks “daniel” user doesn’t have sudo privileges on your system. Please switch to root user or any user with sudo access and run following command.

          sudo echo “deb http://download.virtualbox.org/virtualbox/debian xenial contrib” >> /etc/apt/sources.list
          

          <

          • Avatar alpacket Reply
            June 29, 2017 at 12:21 pm

            [email protected]:~# $ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add –
            $: command not found
            gpg: no valid OpenPGP data found.

            I dont know what i did wrong, thanks in advance.

            • Rahul Rahul K.
              June 30, 2017 at 8:53 am

              It looks you copied command with dollar “$” symbol. Please copy command without dollar prompt.

    • Avatar A.helful.guy Reply
      January 28, 2017 at 8:17 am

      Add that ‘Command’ to the file: /etc/apt.sources.list
      ;D
      Don’t worry, we all started n00bish

    • Avatar sumit sharma Reply
      November 27, 2017 at 8:52 am

      sudo gedit /etc/apt/sources.list

      then copy and past the following at last of the file and Save it.

      deb http://download.virtualbox.org/virtualbox/debian xenial contrib

  26. Avatar anirtek Reply
    January 20, 2017 at 2:06 am

    Its not working for me. Saying that vboxdrv kernel module is not loaded. Please run /sbin/vboxconfig to recompile and run. However when I tried this, its not working again.

  27. Avatar Navnath Kumbhar Reply
    November 21, 2016 at 5:31 pm

    Thank you very much! This really helped.

  28. Avatar Rich Reply
    April 10, 2016 at 2:13 am

    Hello. I used this guide and i got it installed fine. However I noticed that when I open virtualbox from the search bar its different than when I open it from the terminal using virtualbox.

    When I open it from the search the file options is missing, doesnt show the virtual machines, and the GUI is different. If I open from terminal then I can get the file option and it shows the virtual machines.

    I`m not sure if this is normal or not … but it seems really weird. I do not have two different versions installed. I am on Ubuntu 14.04 x64.

    Is there a way to get the terminal version to open without having to run through terminal, like make a shorcut to that version or something? I dont really want the terminal open all the time just to use virtualbox. When I close out of terminal the program closes out as I`m sure you know.

    Thanks for any help on this!

    • Avatar Rich Reply
      April 10, 2016 at 4:19 am

      update:

      It seems to be a difference of root. If I am root by say sudo -i in terminal and then run virtualbox I get the right version to run with all the options and virtual machines.

      However if I am not root and type virtualbox I get a watered down version and now virtual machines. This is the same version that I get if I just open it using search.

      I hope this gives more info into whats going on… if anyone sees this.

  29. Avatar dondhayal Reply
    March 13, 2016 at 9:42 am

    Fetched 819 B in 23s (35 B/s)
    W: GPG error: http://deb.opera.com stable Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 63F7D4AFF6D61D45
    W: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/Release Unable to find expected entry ‘main/binary-i386/Packages’ in Release file (Wrong sources.list entry or malformed file)

    E: Some index files failed to download. They have been ignored, or old ones used instead.

  30. Avatar dondhayal Reply
    March 13, 2016 at 9:41 am

    i download wheezy but download was squeee Fetched 819 B in 23s (35 B/s)
    W: GPG error: http://deb.opera.com stable Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 63F7D4AFF6D61D45
    W: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/Release Unable to find expected entry ‘main/binary-i386/Packages’ in Release file (Wrong sources.list entry or malformed file)

    E: Some index files failed to download. They have been ignored, or old ones used instead.

  31. Avatar Carsten Reply
    February 3, 2016 at 10:50 am

    Hi.

    Very nice and easy to follow guide. However, what now?

    How do I run Virtual Box from my clientcomputer?

  32. Avatar Caleb Reply
    September 11, 2015 at 5:43 am

    Hi, so I have an issue here…

    [email protected]:~$ sudo apt-get install virtualbox-5.0
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Package virtualbox-5.0 is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package ‘virtualbox-5.0’ has no installation candidate

    What do I do?! Thanks

  33. Avatar Arno Reply
    November 24, 2014 at 6:41 pm

    Hi Rahul,

    Works like a charme, thank you for your clear instructions ! Extension pack is already included, USB support worked out of the box.

    Best greetings from Germany.

    Arno

  34. Avatar Thabung Reply
    November 14, 2014 at 6:04 pm

    Hi Rahul,
    I am getting the following error, trying out in Ubuntu 12.04

    ou might want to run ‘apt-get -f install’ to correct these:
    The following packages have unmet dependencies:
    virtualbox-4.3 : Depends: libvpx1 (>= 1.0.0) but it is not going to be installed
    Recommends: libsdl-ttf2.0-0 but it is not going to be installed
    Conflicts: virtualbox-4.3:i386 but 4.3.18-96516~Ubuntu~precise is to be installed
    virtualbox-4.3:i386 : Depends: libc6:i386 (>= 2.15) but it is not going to be installed
    Depends: libcurl3:i386 (>= 7.16.2-1) but it is not going to be installed
    Depends: libdevmapper1.02.1:i386 (>= 2:1.02.20) but it is not going to be installed
    Depends: libgcc1:i386 (>= 1:4.1.1) but it is not going to be installed
    Depends: libgl1-mesa-glx:i386 or
    libgl1:i386
    Depends: libpng12-0:i386 (>= 1.2.13-4) but it is not going to be installed
    Depends: libpython2.7:i386 (>= 2.7) but it is not going to be installed
    Depends: libqt4-network:i386 (>= 4:4.5.3) but it is not going to be installed
    Depends: libqt4-opengl:i386 (>= 4:4.7.2) but it is not going to be installed
    Depends: libqtcore4:i386 (>= 4:4.8.0) but it is not going to be installed
    Depends: libqtgui4:i386 (>= 4:4.8.0) but it is not going to be installed
    Depends: libsdl1.2debian:i386 (>= 1.2.10-1) but it is not going to be installed
    Depends: libssl1.0.0:i386 (>= 1.0.0) but it is not going to be installed
    Depends: libstdc++6:i386 (>= 4.6) but it is not going to be installed
    Depends: libvpx1:i386 (>= 1.0.0) but it is not going to be installed
    Depends: libx11-6:i386 but it is not going to be installed
    Depends: libxcursor1:i386 (> 1.1.2) but it is not going to be installed
    Depends: libxext6:i386 but it is not going to be installed
    Depends: libxinerama1:i386 but it is not going to be installed
    Depends: libxml2:i386 (>= 2.7.4) but it is not going to be installed
    Depends: libxmu6:i386 but it is not going to be installed
    Depends: libxt6:i386 but it is not going to be installed
    Depends: zlib1g:i386 (>= 1:1.1.4) but it is not going to be installed
    Depends: psmisc:i386 but it is not going to be installed
    Recommends: libasound2:i386 but it is not going to be installed
    Recommends: libpulse0:i386 but it is not going to be installed
    Recommends: libsdl-ttf2.0-0:i386 but it is not going to be installed
    Recommends: dkms:i386 but it is not installable
    Recommends: linux-headers:i386
    Recommends: gcc:i386 but it is not going to be installed
    Recommends: make:i386 but it is not going to be installed
    Recommends: binutils:i386 but it is not going to be installed
    Recommends: pdf-viewer:i386
    Recommends: libgl1:i386
    Conflicts: virtualbox-4.3 but 4.3.18-96516~Ubuntu~precise is to be installed
    E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).

    • Avatar A.J. Reply
      December 18, 2016 at 11:04 pm

      I had the same issue. You are most likely missing important software repositories from your /etc/apt/sources.list. https://wiki.debian.org/SourcesList.

  35. Avatar Matt Reply
    November 12, 2014 at 8:30 am

    It doesnt work on my Debian Wheezy:

    virtualbox-4.3 : Depends: libc6 (>= 2.15) but 2.13-38+deb7u6 is to be installed

    Also, 4.3 is not the stable version for Wheezy.

    If i go ahead with the .deb will I screw my dependencies ?

  36. Avatar Edwin Meyer Reply
    November 11, 2014 at 4:43 pm

    Thanks very much for posting this, Rahul. The info is clear and complete (unlike the cryptic info on https://www.virtualbox.org/wiki/Linux_Downloads, and I was able to successfully install VirtualBox 4.3.18 on to my Ubuntu 14.04 OS.

  37. Avatar Hans Reply
    October 15, 2014 at 8:17 am

    Thanks. Followed your tutorial here exactly as written on a Debian Wheezy 32bit.
    Everything went great, until I typed in: # virtualbox
    I got an error: Failed to open the X11 display!
    What am I doing wrong?

    • Rahul Rahul Reply
      October 17, 2014 at 2:52 am

      Hi Hans,

      Do you have Desktop (Like: Gnome, KDE) installed on your debian ? If not please install it first.

Leave a Reply Cancel reply

Popular Posts

  • How to View or List Cron Jobs in Linux
  • How to Install PHP 8 on Ubuntu 20.04
  • How to Set Up SSH Tunnel with PuTTY
  • How to Install Tor Browser on Ubuntu 20.04
  • Issue with phpMyAdmin and PHP: Warning in ./libraries/sql.lib.php#613 count(): Parameter must be an array or an object that implements Countable”
  • How to Allow Remote Connections to MySQL
  • How to Install MySQL 8.0 on Ubuntu 20.04
  • How to Install Apache Kafka on Ubuntu 20.04
© 2013-2021 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy