In late 2012 I got religion about Vagrant ( http://vagrantup.com ) after hearing about it all year.
What is Vagrant?
Using virtual machines running locally on your workstation, Vagrant lets you define the environment your application will run in and quickly iterate on both your application and its environment.
Your Vagrant environment can consist of a single VM or multiple VMs running a wide variety of operating systems listed at http://www.vagrantbox.es (most are unofficial, except those from files.vagrantup.com).
Vagrant quickstart
Vagrant operates on the file named Vagrantfile
in your current working directory. Here's an example Vagrantfile
that sets up an Ubuntu 12.04 (Precise Pangolin) environment:
Vagrant::Config.run do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
end
Once you have Vagrant installed, you can run vagrant init
to create a Vagrantfile
in your current working directory. Try replacing its content with the lines above and running vagrant up
. After the VM has booted try vagrant ssh
and sudo to root. Then log out and run vagrant destroy
.
Vagrantfile examples
To see more complicated environments, look at the Vagrantfile
for these projects:
- https://github.com/pdurbin/greptilian-vagrant
- https://github.com/puppetlabs/puppetlabs-openstack_dev_env
- https://github.com/agoddard/the-super-mini-one-click-chef-solo-apache-demo-that-just-uses-vagrant-up-
- https://github.com/berekuk/play-perl
- https://github.com/discourse/discourse
Vagrant snapshots (with Sahara)
vagrant sandbox on
vagrant sandbox commit
orvagrant sandbox rollback
vagrant sandbox off
After installing https://github.com/jedi4ever/sahara