Skip to content

Creating a Development Environment using Vagrant and VirtualBox

elena edited this page May 15, 2012 · 2 revisions

Creating a Development Environment using Vagrant

This document outlines how you can get a development environment up and running within minutes using Vagrant and VirtualBox.

How it works

Vagrant will download a base lucid VM from the vagrant website (Note: This is a 500MB download). It can then use this VM along with puppet to create a virtual machine which it will run under VirtualBox. The virtual machine will have direct access to part of your file system so you can develop locally and browse to the VM for testing.

Setting up Vagrant

You will need rubygems, vagrant and virtualbox installed on your system

Instructions on installing VirtualBox can be found on the Vitualbox wiki.

To get vagrant installed

sudo aptitude install rubygems
sudo gem install vagrant
sudo gem install virtualbox

Fork zookeepr on github and clone your fork

git clone [email protected]:johnf/zookeepr

Start up the vagrant instance

export PATH=/var/lib/gems/1.8/bin:$PATH
cd zookeepr/vagrant
vagrant up

This will build and start up the VM. You can get a console by running

vagrant ssh

Then run

sudo sh postinstall.sh

You will find the Zookeepr code base in /vagrant this is a shared copy of the zookeepr clone on your local machine.

For more details on how to use Vagrant for development please see the Vagrant website.

Getting Zookeepr running the first time

vagrant up

That's it. That will create the VM and set up everything required for a running zookeepr instance.

You can browse to it at http://localhost:8080

You can now edit code locally and it will immediately be visible to the VM. You can even view the VMs logs on your local laptop in the logs directory.

Normal Workflow

When you are finished with the VM you can do

vagrant destroy # Don't do this

However that will totally destroy it so instead you probably want one of

vagrant suspend
vagrant halt