The most simple way of installing VirtualBox is to use the command:
$ sudo apt-get install virtualbox
However, the version that comes with Ubuntu is fairly old. I decided to connect directly to www.virtualbox.org to get the latest version.
The following commands add virtualbox.org to the list of source repositories used by
apt
and installs the 5.1 version of VirtualBox.
Add the following line to your /etc/apt/sources.list:
deb http://download.virtualbox.org/virtualbox/debian yakkety contrib
The name yakkety
is the name of the Ubuntu 16.10 distribution.The following commands adds the repository key file so that will be treated as a trusted site. Then the VirtualBox 5.1 is installed. Since I already have
dkms
the installation should automatically be updated when the kernel is updated.
$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc
$ sudo apt-key add oracle_vbox_2016.asc
$ sudo apt-get update
$ sudo apt-get install virtualbox-5.1
Ready to go.