A Quick Linux VM On Windows With Vagrant: Created by Brennen Bearnes
A Quick Linux VM On Windows With Vagrant: Created by Brennen Bearnes
Guide Contents 2
Overview 3
Install Vagrant 5
Install msysGit 10
Install VirtualBox 14
Run Bash and Fire up a New Vagrant Box 16
Vagrant is a software package designed to let you easily create disposable VMs from a library of
freely-downloadable images and connect to them, all with a few simple commands in a terminal.
The idea is that you can continue to run your desktop OS like Mac OS X or Windows 7 or whatever,
but then make a tiny new Linux computer in a window that you can connect to whenever you need
to run Linux software
1. Vagrant itself
2. VirtualBox to run virtual machines
3. msysGit, a Windows distribution of Git and some other Unix tools, for cloning git repositories
containing Vagrant configurations and connecting to your new VM with SSH
If you already have msysGit or the Cygwin tools installed, you can likely skip this step.
Again, visit the msysGit site (http://adafru.it/eBy) and look for a "Download" button.
Run the installer. Windows will likely ask you several times if you'd like to allow the installer to run
and modify your system.
As with Vagrant and msysGit, run the installer, and click through options. Defaults should be fine.
This is a version of Bash, which is a standard shell on GNU/Linux systems (for shell basics, start
here (http://adafru.it/eBz)). Fire it up and enter the following commands:
mkdir vagrant_demo
cd vagrant_demo
vagrant init hashicorp/precise32
You should now have a folder containing a basic Vagrantfile . (There's a lot of
documentation (http://adafru.it/eBA) on Vagrantfiles.)
Next, do vagrant up , which should download an image, set it up, and start a virtual machine running
in VirtualBox. This will probably take a while.
Continue with the Getting Started section (http://adafru.it/epm) of the official Vagrant manual.
Check out our ongoing series of introductory Linux tutorials:
Once you're done with a machine, you can remove it with vagrant destroy .
If you're interested in trying other operating systems and configurations, read the manual on
boxes (http://adafru.it/eBM), then have a look at the list of available boxes from
HashiCorp (http://adafru.it/eBN) - you're not limited to these, but it's a good place to start.