& portable
 development environments

Memphis  Python User Group

Who is this guy!?

Joe Ferguson


  • Web Developer at RocketFuel

  • PHP / LAMP Focused

Semi Professional

  • Co-Organizer for

  • MidsouthMakers - Hackerspace Leader

  • Organizer

What is vagrant?

  • Tool for building complete dev environments

  • Easy to use workflow

  • Focus on automation

  • Lowers Dev Environment setup time

  • Increase Dev / Live Environment Parity


Vagrant configures a Provider

  • Virtualbox

  • VMWare

  • AWS

Provisioners Configure the VM

  • Puppet

  • Chef

  • Salt

  • Shell

Vagrant use case

Spin up a server for:
  • Test versions of your web app
  • Test group policy permissions
  • Test system updates before live

Spin up a desktop for:
  • Test versions of your system app
  • Isolate your development tools
  • Test system updates before live


How do you currently configure your environment?

Stop manually installing apps and configuring settings!

Which provisioner?

Chef - Cookbook based

Puppet - Manifest based

Shell (Batch Files) - Who doesn't love the shell?!

Vagrant philosophies

Why manually do something when your can let your provisioner do it for you?

Vagrant boxen are insecure, defaults to vagrant/vagrant

Vagrant uses Windows Remote Management tool (WinRM) to interact with your box

User Access Control (UAC) is a bad idea*

You will also need vagrant-windows plugin

User Access control*

In general, UAC is a bad idea because it likes to interfere with vagrants handling of your machine.**

If you're wanting to test UAC, be weary of any odd things may be a result of vagrant and UAC being enabled**

** I am not a windows guy, Brian made me do this. Feel free to correct me!

Go download a vagrant box!


You all have to deal with licensing...

Let's make a vagrant box!

First we have to create a Virtual Machine...
  • install a base windows system
  • install guest additions
  • create vagrant user as admin
  • turn off UAC
  • disable complex passwords*
  • disable shutdown tracker
  • disable server manager starting
  • Enable and configure WinRM
  • WinRM 1.1 needs more tweaks

Save the VM as a box

c:\>vagrant package --base VM-Name --output

This will:
  • halt the VM
  • export the VM
  • compress the VM

What you will have is ""

Add the new Vagrant box

Now that we have, we need to add it to vagrant's available boxes.

c:\>vagrant box add MyFirstBox

This will import the box into vagrant and when this process completes:
c:\>vagrant box list

You should see "MyFirstBox" in the list of available boxes

Creating the vagrant file

Create a folder to hold our Vagrant Project

C:\>mkdir VagrantRocks
C:\> cd VagrantRocks
C:\>vagrant init

This will put a Vagrantfile in VagrantRocks/

Edit Vagrant file based on the sample found here:

Tweaking the Vagrant File

You will likely need to change the forwarded port 3389 if you have Remote Desktop enabled.

Feel free to use my sample as a guide:

The Vagrant File

Vagrant.configure("2") do |config|
  # Configure base box parameters = "MyFirstBox"
  # config.vm.box_url = "./vagrant-windows7x64box"
  config.vm.guest = :windows
  config.vm.provider :virtualbox do |vb|
     vb.gui = true
  end = "1" = "localhost"
  # Port forward WinRM and RDP :forwarded_port, guest: 3389, host: 3389 :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct: true



By Joe Ferguson

Navigation instructions

Press the space key or click the arrows to the right


Customized version of my Vagrant talk given to the Memphis, TN .Net User Group

  • 571

More from Joe Ferguson