Kirk Evans Blog

.NET From a Markup Perspective

My New Dev Rig: Boot to VHD and Hyper-V

I have a Lenovo T61P with 8 GB RAM.  That’s what I use to do demos.  To many devs, they’re thinking, “oh man, wish I had that much RAM”.  I wish you did, too, because the ROI of adding RAM for developers is an easy justification.  But here’s the thing… I don’t just dev with this machine… I do a lot of demos.  When showing off our great developer tools and the fantastic Windows Server platform, the last thing I want to do is to have to explain, “well, my machine is really slow because I am running 5 virtual machines.”

Sometimes I can connect to a remote machine that has a ton of RAM to do my demos.  When I travel to customer sites, I usually do not have connectivity, so I can’t connect to a remote machine… everything has to be installed locally.  My ideal scenario is:

  • Run SharePoint and Visual Studio and Team Foundation Server locally with as much RAM as I can get.
  • Connect the OS that has all my demos to a domain controller.  I will infrequently need to connect to the DC, so I can take advantage of cached credentials.

The first option is to install everything to my Windows 7 day-to-day environment, which I did.  I have SharePoint Foundation 2010 installed with SQL Express on my day-to-day environment with Visual Studio 2010, it’s quite convenient to answer emails, write a quick blog entry, write a web part, debug some ASP.NET MVC code, etc all on the same machine without rebooting. 

The demo environment I am working on uses things like user profile imports.  I can’t really put that on my corporate machine.  Virtualization seems like a good choice here.  When thinking about the choices, remember that SharePoint 2010 requires a 64 bit OS, which limits some of your choices of how to approach this.  For instance, you can’t just run Virtual PC, because right now it only supports a 32-bit guest OS.  Hyper-V supports 64-bit guest OS machines, which requires the host machine is Windows Server.  So, the first decision I make is that I need a 64-bit OS, but should it be virtual or native?

My first option is to just run everything using Hyper-V.  I have 8 GB RAM, and the Hyper-V guidance says you should allocate at most 70% of your host’s RAM to the virtual machines.  This means that I could allocate roughly 5.2 GB RAM to SharePoint, and 500 MB RAM to the domain controller.  But that sucks, because I very infrequently would need that 500 MB RAM, so I feel like it’s kind of wasted.  Using Hyper-V guests has the distinct upside of being able to use snapshots and save state, also allowing me to export the virtual machine to a USB drive and use it on another machine.

Another option is to use Boot to VHD.  This allows my machine to use all of the RAM and CPUs for my machine.  I get all the perf with the self-containment of virtual machines.  It’s not a virtual machine, so I don’t get backup capabilities like I do with Hyper-V, but I get the benefit of having access to all 8GB of RAM for my machine.  I really like this option, personally. 

What I ended up choosing was to use Boot to VHD and install Windows Server 2008 R2.  Once installed, I added the Hyper-V role.  In Hyper-V, I created a new virtual machine and created a domain controller.  Back in the host OS (which is boot to VHD), I join the domain that I just created.  Once I have logged on and my machine is a member of the domain, I can now shut down the domain controller and use the cached credentials from the domain.

There ya have it… I have all 8GB RAM at my disposal for SharePoint and Visual Studio, and when I need to work with the domain controller I just load up the guest virtual machine in Hyper-V.