Tag Archives: automation

Vagrant on Windows Howto

In a nutshell, Vagrant provides VM’s-in-a-can with all the settings predefined. No need to get an iso, setup a vm, install the os, share your ssh key etc.. That’s all done in vagrants config and turns the whole process into 2 steps: init and up. You can automate multiple VM’s and preconfigure them to talk to each other on the same network etc… Its gets really cool when you’re trying to simulate cloud setups or complex multi-machine environments. I’m assuming for this post that you’re running everything 64 bit (Welcome to this decade 🙂

Install a Hypervisor

Note: By default Vagrant uses VirtualBox so go with that one
1. Download and Install from the VirtualBox Website

Install Vagrant

  1. Download and install from the Vagrant Website
  2. Reboot to finish the install

Install Cygwin

Note: This is optional but your life will be easier if you run Vagrant from a linux like shell

  1. Download and install Cygwin from the Cygwin Website
    • Install ssh client
  2. Fix for Vagrant 1.7.4 bug 1
    $ vi .bashrc
    export VAGRANT_DETECTED_OS=cygwin
    

Create your 1st VM

  1. Open a cygwin terminal command prompt
    “Start Button/All Programs/Cygwin/Cygwin64 Terminal”
  2. Create a vagrant working directory
    $ mkdir vagrant
    $ cd vagrant
    
  3. Initialize and start a vm 2
    $ vagrant init hashicorp/precise64
    $ vagrant up
    
  4. Remote into the vm and have a ball!!
    $ vagrant ssh
    

Cleaning Up

  1. Nuke the VM you just created 3
    vagrant destroy
    

  1. If you don’t do this Vagrant may complain about a missing TTY for certain commands 
  2. Here is a list of Available Systems 
  3. If Vagrant complains about a missing TTY use “–force”.