Install VirtualBox on Ubuntu and Debian Linux

In this post, we will see how to install VirtualBox on Ubuntu and Debian Linux. If you are a newbie, you may have a few questions: What is VirtualBox? What does VirtualBox do? In short, VirtualBox, originally developed by Sun MicroSystems and now owned by Oracle, is a virtualization software that can simulate a standalone computer. Each standalone computer (aka virtual appliance) can run its own operating system (guest OS) and is self-contained (delete the appliance and your host system is back to its original state). The appliances can interact with each other and be a part of your home network and will be treated as a separate system. Because of these features and more, VirtualBox allows you to test various operating systems, without making permanent changes to your host OS. [Read: Install Ubuntu Server 14.04 Trusty Tahr as a home server]

Install Virtualbox On Ubuntu And Debian

We recently presented some of the best home server operating systems. VirtualBox would allow you to test these operating systems before you select one. Alternatively, you may actually run your server operating system or media server from your VirtualBox instance 24/7: you may not want to mess with your Ubuntu system that is working flawlessly and may choose to run your server from within a VirtualBox appliance without disturbing your host Ubuntu. Or you just want a test system to mess with and learn from. Sounds exciting? How to run your server from VirtualBox is a topic for another post. For now, let us look at how to install VirtualBox on Debian and Ubuntu Linux.

Recommended HTPC / Home Server Builds:

Before you begin, enable Intel VT-x hardware virtualization in BIOS or UEFI firmware. This is required for VirtualBox to run.

Install VirtualBox on Ubuntu and Debian Linux

Before installing VirtualBox on Ubuntu, a package known as dkms must be installed. This is needed to make Virtual Box continue to work with any updated kernels in future.

sudo apt-get install dkms

Next, the easiest way to install VirtualBox on Ubuntu is through the official Ubuntu repositories. However, VirtualBox in the Ubuntu repository is always a few minor versions older. For most users, this makes no difference and so the command below should be sufficient.

sudo apt-get install virtualbox

You may skip the rest of the steps. However, if you want the latest version of VirtualBox then you will have to install VirtualBox on Ubuntu from Virtualbox official repository. First, add the repository key using the following command:

wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add - 

Next, add the VirtualBox repository using the following command. This post shows how to install VirtualBox on Ubuntu 14.04 LTE. You may have to replace trusty with the release you are using (see below for instructions):

sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian trusty contrib" >> /etc/apt/sources.list.d/virtualbox.list'

Replace the word trusty in the above command with the release name corresponding to your release number:

  • vivid - 15.04
  • utopic - 14.10
  • trusty - 14.04 LTE
  • saucy - 13.10
  • raring - 13.04
  • quantal - 12.10
  • precise - 12.04 LTE

Next, refresh the packages list using the command below:

sudo apt-get update

Next you will have to find out the package name for the latest version of virtual box. To that run the following command:

sudo apt-cache search virtualbox

From the displayed list (as shown in the picture below), note down the package name for the latest version of virtualbox. Currently, it is virtualbox-4.3.

Latest Virtualbox Package Name
Latest Virtualbox Package Name

Finally, install VirtualBox on Ubuntu and Debian Linux using the following command:

sudo apt-get install virtualbox-4.3

Once the VirtualBox installation finishes you should be able to find it in your menu.

Virtualbox On Xubuntu
Virtualbox On Xubuntu

There you have it, Virtual Machine for Ubuntu and Debian. You may also use this guide to install VBox on Ubuntu Server edition. Using Ubuntu or Debian VirtualBox Extension pack or VirtualBox Guest Additions, you can add several more features to VirtualBox. VMware is another major virtualization software, but VirtualBox has always been my favorite, even-though it has its quirks. Go ahead install VirtualBox on Ubuntu and Debian play with almost any OS.

Complete Guide to Setting Up a Home Server on VirtualBox Virtual Machine:
  1. Install VirtualBox - Windows 7/8/10 / Ubuntu/Debian
  2. Install VirtualBox Extension Pack - Linux and Windows Host
  3. Install Guest OS on Virtual Box - Ubuntu Server
  4. Install VirtualBox Guest Additions - Windows Guest / Linux Guest
  5. Update VirtualBox Guest Additions - Windows Guest / Linux Guest
  6. Setup VirtualBox Shared Folder - Windows and Linux
  7. Mount VirtualBox Shared Folder - Windows Guest / Ubuntu Guest
  8. Access USB Drive on VM - Windows and Linux Guest
  9. Configure Home Server on VirtualBox - Ubuntu Server
Be the 1 in 200,000. Help us sustain what we do.
25 / 150 by Dec 31, 2024
Join Us (starting from just $1.67/month)

Anand

Anand is a self-learned computer enthusiast, hopeless tinkerer (if it ain't broke, fix it), a part-time blogger, and a Scientist during the day. He has been blogging since 2010 on Linux, Ubuntu, Home/Media/File Servers, Smart Home Automation, and related HOW-TOs.