Install VirtualBox 5.1 on Ubuntu 16.4

February 2, 2017 - Linux

Option 1 with Guest additions
Link to iso

sudo apt-key adv --keyserver --recv-keys A2F683C52980AECF
// or
sudo apt-key adv --keyserver --recv-keys A2F683C52980AECF
sudo apt update
sudo apt-get install virtualbox-guest-additions-iso

Option two – USED

sudo sh -c "echo 'deb '$(lsb_release -cs)' contrib non-free' > /etc/apt/sources.list.d/virtualbox.list" && wget -q -O- | sudo apt-key add - && sudo apt-get update && sudo apt-get install virtualbox-5.1

Had issues with Virtual box and removing secure boot solved it.

// just testing solutions - don't use!
sudo apt-get install build-essential module-assistant 

sudo apt-get remove virtualbox* --purge


modprobe vboxdrv

add vboxdrv into /etc/conf
sudo /usr/lib/virtualbox/ setup

apt-get install linux-headers-`uname -r`
dpkg-reconfigure virtualbox-4.2

The normal way:

/etc/init.d/vboxdrv setup