Monday, April 20, 2015

Vagrant + VirtualBox = Awesome

Have you ever wanted to create a test environment for some some code, but you didn't have the time or patience to create VMWare or VirtualBox instances for your target OS? Let Vagrant do the tedious work for you!

I first used vagrant when going through Udacity's Apache Storm course. The course has you install git bash, vagrant, and virtual box. It then has you clone a repo that includes a vagrantfile that points to their vagrant box for the course. Running "vagrant up" in the directory with the vagrantfile will cause vagrant to download the vagrant box (or image). You can run "vagrant up" again after the box is downloaded, and it will start the box using Virtual Box. You can "connect" to the box using "vagrant ssh".

I used to use AWS to spin up instances for testing code, but that can be kind of expensive. Now I can get similar virtual machines in about the same amount of time, but for freeeeeeee!!!! 

The Vagrant website's "Getting Started" guide has you downloading and running boxes right away. The guide also points you to the site where you can discover other vagrant boxes that are free to download and use. 

I've seen references to vagrant numerous times, but never bothered to check it out before going through the Udacity course. I can't wait to see what I can hit with my vagrant hammer!