VirtualBox - Install VirtualBox on Linux (Debian / Ubuntu) thanks to packages or from its official website

Page 1 / 2

As you may know, VirtualBox is multi-platform. Which means that you can install this virtualization solution on many platforms including : Windows, Mac OS X, Linux (Debian, Ubuntu, ...) and Solaris.

To install VirtualBox under Linux, you have 2 possibilities :
- use the package system of your distribution, but you may not get the latest version of VirtalBox
- directly download the ".deb" or ".run" file for your Linux distribution from the official VirtualBox website : in this case, you will have the latest version of VirtualBox

Note : tutorial tested under Debian 7.7.0 x64.

  1. Installation via packages
    1. Installation of VirtualBox
    2. Installation of VirtualBox extension pack
  2. Installing the latest version from the official VirtualBox website
    1. Installation of VirtualBox
    2. Installation of VirtualBox extension pack

1. Installation via packages

1.1 Installation of VirtualBox

To begin, edit the list of package sources.

Bash

vi /etc/apt/sources.list

In this file, add the line below.
Note : replace <distribution_name> with the name of your Linux distribution (right value) :

  • Ubuntu 17.10 : artful
  • Ubuntu 17.04 : zesty
  • Ubuntu 16.10 : yakkety
  • Ubuntu 16.04 LTS : xenial
  • Ubuntu 14.04 LTS : trusty
  • Debian 9 : stretch
  • Debian 8 : jessie
  • Debian 7 : wheezy

Plain Text

deb https://download.virtualbox.org/virtualbox/debian <nom_de_la_distribution> contrib

From Debian 8 (Jessie) or Ubuntu 16.04 (Xenial), download and store the new public key using this command:

Bash

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -

For older Linux distributions, use the command :

Bash

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

Then, update the package list.

Bash

apt-get update

If you get this error :

Plain Text

E: Le pilote pour la méthode /usr/lib/apt/methods/https n'a pu être trouvé.

Install the "apt-transport-https" package and then restart the update of the package list.
Note : answer "O" to the "Should these packages be installed without verification" question.

Bash

apt-get install apt-transport-https

Install VirtualBox 5.2.x by installing the "virtualbox-5.2" package.
Note : as indicated at the beginning of the tutorial, you may not get exactly the latest version of VirtualBox.

Bash

apt-get install virtualbox-5.2

Once the installation is complete, launch VirtualBox from the GUI of your Linux distribution.

At the time of writing this tutorial, the installation of this package allowed me to install VirtualBox version 5.2.14 instead of the latest version 5.2.18 available on the official website of VirtualBox.

1.2. Installation of VirtualBox extension pack

If you want to install the VirtualBox extension pack to support the VirtualBox RDP, PXE boot, ... just download these extensions from the VirtualBox site in the same version as VirtualBox.

For this, you can do it on the command line (root rights required).

Bash

su

Download the extension pack with the command below.
Note : replace "<vbox_version>" with your version of VirtualBox.

Bash

wget https://download.virtualbox.org/virtualbox/<vbox_version>/Oracle_VM_VirtualBox_Extension_Pack-<vbox_version>.vbox-extpack

Then, install it like this :

Bash

VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-<vbox_version>.vbox-extpack

The license will be displayed in the terminal.
Note : answer "y" to the question asked at the end of the license.

Plain Text

VirtualBox Extension Pack Personal Use and Evaluation License (PUEL)

License version 10, 20 July 2017

PLEASE READ THE FOLLOWING ORACLE VM VIRTUALBOX EXTENSION PACK PERSONAL
USE AND EVALUATION LICENSE CAREFULLY ...

Do you agree to these license terms and conditions (y/n)?

The installation is done.

Plain Text

License accepted. For batch installation add
--accept-license=56be48f923303c8cababb0bb4c478284b688ed23f16d775d729b89a2e8e5f9eb
to the VBoxManage command line.

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Successfully installed "Oracle VM VirtualBox Extension Pack".

Once installed, you can check it via the "File -> Preferences -> Extensions" menu of VirtualBox.

Si vous voulez le télécharger et l'installer depuis l'interface graphique de votre distribution Linux, ouvrez le navigateur web de votre distribution Linux et allez dans la section Downloads du site de VirtualBox.
Sur cette page, repérez la partie "VirtualBox x.x.xx Oracle VM VirtualBox Extension Pack" et cliquez sur le lien "All supported platforms".

If you want to download and install it from the GUI of your Linux distribution, open the web browser of your Linux distribution and go to the Downloads section of the VirtualBox site.
On this page, locate the "VirtualBox x.x.xx Oracle VM VirtualBox Extension Pack" section and click on the "All supported platforms" link.

Once the download is complete, launch VirtualBox and go to the "File -> Settings" menu.

In the "Extensions" tab, click on the + icon to the right of the list.

Select the "Oracle_VM_VirtualBox_Extension_Pack-x.x.xx.vbox-extpack" file you just downloaded and click Open.

Confirm the installation of this extension pack.

Accept the VirtualBox license.

The extension pack is installed.