Build a Windows lab with VirtualBox, Packer and Vagrant, adding sysprep (part 2)

In my former article I elaborated on how to create a lab with Windows servers quickly using Vagrant, Packer and Virtualbox. What I did not realize at that time is that the box I created had 2 issues:

  • The box is not sysprepped. The sysprep is mandatory if you want to create a Domain Controller and are adding boxes to the domain. You’ll end up with 2 boxes with the same SID.
  • The MAC address is cloned for every Vagrant machine that is based on the box. This becomes a problem if you want to place the hosts in a bridged network.


Then I went and Googled (after trying in vain myself) and found this repository: Someone has already done it.

Step 1:
Here is a link to the json file:
Copy this file to the packer-windows folder and save it as ‘windows_2012_r2_sysprep.json’

Step 2
Make sure you copy the Autounattend_sysprep.xml file from \packer-community-templates\answer_files\2012_r2 to the \packer-windows\answer_files\2012_r2 folder.

Now you can run packer build -only virtualbox-iso windows_2012_r2_sysprep.json. And grab a coffee.

MAC address

The MAC address can be set in the Vagrant file for each machine. First you need to know what the name is of the network interface for the bridge.


Then you can insert the name of the nic in the Vagrantfile like this (see the marked lines):

So there it is.

I use Ubuntu as a development workstation (but it doesn’t matter!)

I use Ubuntu as my development machine and I like to evangelize about it. But actually it doesn’t matter at all. It’s the functionality I run that is the most important. And since that is the case, the underlying OS becomes irrelevant. That’s why I tend to choose the OS with the smallest footprint. Which would be a Linux based OS.

So here is why, and how, I use Ubuntu.


This picture is Ubuntu running in Parallels, which looks great in high res on the MacBook Pro Retina screen.

Some Linux advantages over another OS

There are some advantages of running Ubuntu (or another Linux distro):

  • system requirements are low, you can happily use older hardware
  • the software is open source and free (as in ‘costs nothing’, although I donate to my favourite open source projects like LibreOffice and Ubuntu itself).
  • installation is easy, however installing Windows is easy too.
  • installation is fast because Ubuntu has a smaller footprint than Windows (8 GB vs 20 GB, and then Ubuntu is considered large in comparison with e.g. Puppy Linux)
  • installation of software is a delight, because of the packaging method (apt, yum, rpm, pacman and so forth). With a package manager you do not need to browse to websites to grab a copy
  • Updating is just as simple apt-get update && apt-get upgrade
  • If you prefer to work with the keyboard and in the terminal, Linux is your best fried. Just choose your terminal, your favourite shell, your favourite editor and your good to do any kind of task

So how do I use Ubuntu?

  • I am a keyboard user. Ubuntu is very friendly for keyboard users! Especially the Dash is very handy:
  • As IDE I use Subtext and Vim. In Vim I us the NERDTree. Vim deserves a dedicated post. It’s an extremely versatile editor that lives in the terminal and it is very small (6 MB). It has a steep learning curve. But when you get the hang of it you’ll notice how powerful it is. And Vim is ubiquitous. It’s everywhere (as Vi on every Linux machine). Once you know vi, you can deal with every Linux machine out there.
  • I use Robomongo to browse Mongo databases.
  • The Gimp is a great Photoshop replacement, especially now that you can enable single Windows!
  • Chrome is my mainbrowser. I use the apps a lot so I have access to them on every machine.
  • Last but not least: I use XMind for mindmapping. It is multiplatform. And I love it. It too deserves a dedicated post.


So I use Ubuntu

And yes, I can do all above mentioned things on my Mac and Windows machine as well, but going the Ubuntu way the footprint is the smallest.