Installing Vagrant/VirtualBox on Ubuntu Trusty

Vagrant/VirtualBox on an Ubuntu Trusty production server

Preliminary stuff

sudo apt-get update && apt-get dist-upgrade -y
sudo apt-get install git -y

Install VirtualBox

Note: Ubuntu/Debian users might want to install the dkms package to ensure that the VirtualBox host kernel modules (vboxdrv, vboxnetflt and vboxnetadp) are properly updated if the linux kernel version changes during the next apt-get upgrade.

For Debian it is available in Lenny backports and in the normal repository for Squeeze and later [].

The dkms package can be installed through the Synaptic Package manager or through the following command:

sudo apt-get install dkms -y

The VirtualBox package in Ubuntu (as of the last known release for 14.04) has some issues when running in RAM-constrained environments [], so it’s best to install from Oracle’s website:

echo "deb trusty contrib" | sudo tee -a /etc/apt/sources.list > /dev/null
wget -q -O- | sudo apt-key add -

sudo apt-get update

sudo apt-get install linux-headers-3.13.0-35-generic -y
sudo apt-get install virtualbox-4.3 -y

sudo /etc/init.d/vboxdrv setup

At this point I would probably reboot:

sudo reboot

Install Vagrant

sudo dpkg --install vagrant_1.6.5_x86_64.deb

or, for 32bit:

sudo dpkg --install vagrant_1.6.5_i686.deb


Leave a Reply

Your email address will not be published. Required fields are marked *