Installing Windows 2008 Server R2 into a virtual hard disk (VHD)

September 2010

It started as a simple task on a Sunday evening. I wanted to get Windows Server 2008 R2 running on my home network for some dev work, however it’s 64bit only and my trusty home webserver is 32 bit and frozen in time on Windows Server 2003. As I didn’t fancy forking out on new hardware the next plan was to install Windows Server 2008 on my workstation and work directly on it with Visual Studio. The machine is a 64bit Athlon and runs 5Gb of RAM, dual-booting into Windows 7 Enterprise and XP Pro

This seemed a good plan, but I didn’t want to mess around with my machine too much as I heard Windows Server can be a bit brutal with existing boot menus etc. so thought I’d try running it in Virtual PC, which I already use for a couple of Win XP instances on Windows 7. Unfortunately I then discovered Virtual PC doesn’t support 64 bit operating systems (even though I’m running 64 bit Windows 7....) so it was back to the drawing board....

After a bit of nosing around I found that you can install Windows 2008 Server R2 directly into a virtual hard drive (VHD) and, this is the clever bit, boot this VHD like you would any other native operating system. Apparently this is supported by Windows 7 as well, allowing you to build a dual (or more...) boot machine that actually has no operating system and simply boots into local VHD files. This is then a great way of having multiple environments on the same physical machine, and allows you to easily drop an instance and copy over a clean install with minor downtime

The actual steps are pretty straightforward:

That’s it really – it added Windows Server 2008 as an option to my main boot menu without removing the Windows 7 or XP entries, and created a neat VHD file with the whole installation on it. You can back this up like any normal VHD, redeploy or even delete the file and edit the boot menu using the bcdedit command to get back to where you started

After this it was an easy job to configure Windows Server for IIS, run the latest updates and install Visual Studio 2010 RC. Job done.

| Home |