For the past few months I’ve been sharpening my Windows 7 skills and discovered what many systems people already know; “you can easily setup and boot Windows 7 or Server 2008 R2 VHD.”
Someone may already be thinking, why do I need to boot a VHD?
It’s no secret that Microsoft will be shipping Visual Studio 2010 Beta2. If you want to be notified when Beta2 ships you can sign up here: http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx
Some developers prefer to install beta software on a non-production machine or set up a multi-boot box.
This is where VHD’s come into play. You can setup a VHD on your desktop or laptop, then from the boot menu, select to boot that VHD or boot the operating system. I’ve been doing this at home and work for awhile now and love it.
VHD’s also enable you to have a x32 O/S boot and a x64 O/S boot on the same machine. Possibilities are endless.
When you’re done with the VHD, just delete it and make a new one.
VHD’s sport great performance. If you use the fixed size VHD, the total performance cost is 3%. When I boot a VHD on my laptop I don’t see any drop in performance from booting the original O/S.
VHD’s do not require Hyper-V to boot them. Server 2008 R2 does have a Hyper-V feature that allows you to log onto a VHD. But what I’m explaining here does not require Hyper-V. This is why I love this feature, it just works.
Before creating a new VHD, defrag the volume you want to add the VHD to.
I always create a fixed size VHD to ensure maximum performance. Dynamic sized VHD’s offer flexibility with respect to size but pay a performance hit.
I’ve been allocating 45GB for all my VHDs. This leaves plenty of room for Windows 7, Visual Studio, Microsoft Office and other applications and data on the VHD. After you have created and configured a few of these, you’ll determine what works best for you.
I created a c:\vhd folder and locate all my VHD files here.
Possible Configuration Scenarios
Computer has Windows 7 or Server 2008 R2 installed and one or more Windows 7 or Server 2008 R2 VHD’s.
Computer does not have any O/S installed, but has one or more VHD’s that can be booted. How cool is this?
Possible VHD Installation Options
Create a new VHD and install Windows 7 from a DVD or network location.
Create a new VHD and use imagex.exe to restore a .wim file to the VHD. This is my favorite. This saves so much time. You install an O/S, configure it and install all the other software you need (except Visual Studio). Then use imagex.exe to save a copy of the O/S and software to a .wim file. You can then use imagex.exe to restore that .wim file to a VHD or if you need to a boot partition. I do this at work every 1-2 weeks. Takes a few minutes to pave my box. Awesome software imagex.exe is!
On my laptop and desktop systems, I keep an extra VHD file that is all ready to go. It’s configured and has all the software I need except Visual Studio. Then when I want to load up another version of Visual Studio, I copy the files I need, delete the old VHD, copy the standby VHD to another new VHD, boot the new one and install Visual Studio. Even on my laptop with the 45GB file copy and installing a new Visual Studio I’m up and running quickly.
What is imagex.exe? Read this: http://technet.microsoft.com/en-us/library/cc507842.aspx
Where can I get imagex.exe? Here: http://www.microsoft.com/downloads/details.aspx?familyid=696DD665-9F76-4177-A811-39C26D3B3B34&displaylang=en.
Read how Scott Hanselman uses imagex.exe. Great blog post! Step-By-Step: Turning a Windows 7 DVD or ISO into a Bootable VHD Virtual Machine
Rather that create a new blog post with pictures, etc, I’m going to provide the links that I’ve used to be successful with VHD’s.
Microsoft TechNet: Windows 7 Boot from VHD. This is actually the home page for a 3 part series on VHD files. Very well written and covers the scenarios I’ve listed above.
Microsoft Evangelist Keith Combs:
I hope you find this information informative and useful.
Have a great day,
Just a grain of sand on the worlds beaches.