# How to Setup Vagrant

What is Vagrant ?

The big question, which I was thinking, when I first heard of it. So today finally got a chance to do some hands on. Basically it is a tools which gives you running VM, whenever you need it with all your environment set in place. So what was that huh? Consider that you are creating a VM or clonning a VM and starting it up and running some script to get the environment set in place. So why not automate this whole thing by vagrant.

Vagrant allows you to launch VMs with provisioning on top of it.

Some Nomenclature

box : Base image of an OS, Read here

Provider : Hyperviosr in which VMs are going to run. These are Virtualbox, VMware and many more. Read here

Provising : Tools like Puppet, Chef, Ansibal and ofcourse Shell script. Read here

Working environment is Ubuntu 12.04

Install this packages

Know the Virtualbox and Vagrant is installed, we will add box in vagrant.

It will take some time, and depends on your bandwidth. After the download is completed, there will be a Vagrantfile in the working directory.

Open the Vagrantfile and change this line to

You can list the boxes, like this

Now we can start the box with this command.

Then we will login into the box.

Running some command under the box.

Hope this clear your basic doubts, Feel free if there is any question.