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 [https://www.virtualbox.org/wiki/Linux_Downloads].

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 [https://github.com/deis/deis/blob/master/README.md], so it’s best to install from Oracle’s website:

echo "deb http://download.virtualbox.org/virtualbox/debian trusty contrib" | sudo tee -a /etc/apt/sources.list > /dev/null
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -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

wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.5_x86_64.deb
sudo dpkg --install vagrant_1.6.5_x86_64.deb

or, for 32bit:

wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.5_i686.deb
sudo dpkg --install vagrant_1.6.5_i686.deb

Done!

Leave a Reply

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