In this article I will cover creating a bootable Windows 7 VHD. If you missed the previous article on creating a VHD titled How To Create a Virtual Hard Disk (VHD) in Windows 7 you may want to take a few minutes and visit this article first. You may be asking yourself why would I want to boot from a VHD? In my case I want to install the recent beta releases of Microsoft SharePoint 2010, Office 2010, and Visual Studio .NET 2010 without impacting my primary operating system. This is where a bootable VHD saves the day. Be sure to look here for VHD’s from Microsoft.
Virtualization and the Midsize Organization: How Much Does It Help? You may wonder how much value virtualization actually has for your organization. Midsize businesses deal with issues that differ from those of larger enterprises. Are you looking for specific information about virtualization and how it can impact your business? Perhaps few of your peers in this midmarket class of enterprises have reached a high level of experience in virtualizing, and you need a dollars-and-cents rationale before considering beginning the virtualization process. Given hard experience adopting new technologies, you also need assurance that you can engage in virtualization without severely interrupting business.
The requirements for completing this tutorial are:
- Running an existing Windows 7 operating system
- You will need you original Windows 7 installation disk
- Download and install Windows Automated Installation Kit (AIK) for Windows 7
Again I am picking up from How To Create a Virtual Hard Disk (VHD) in Windows 7 and I will utilize the VHD that I have previously created.
Click Start -> All Programs -> Microsoft Windows AIK -> Deployment Tools Command Prompt

From here we will be using imageX which is utilized to capture and modify Windows images. To understand the various command line option type imageX /? and the command prompt for greater details. For my purposes I will not go into details of the various options rather I will demonstrate how to copy over Windows 7 to the VHD. Remember that your folder structure many differ from mine so make changes as necessary. Run the following command (also keep in mind the index #4 references Image Index i.e. edition of the Operating System):

To view the indexes run:
imagex /info D:/PATH TO WIN7/install.wim
In my example, I am going to create a VHD of Windows 7 Ultimate by executing the following:
imagex /apply D:/sources/install.wim /check 4 Z:/
The entire process should take 5-15 minutes to complete. Once it does so then detach the VHD.
Next we need to create the boot loader entry and this is done by using bcdedit. Go back to your command prompt and enter the following:
bcdedit /copy {current} /d “Win7 Ultimate Dev VHD”
Upon running the above command you will be presented the current CSLID, copy this CSLID to your clipboard then run the following commands:
bcdedit /set {INSERT CSLID HERE} device vhd=[C:]/VirtualMachines/Windows 7x64Ultimate/Win7x64Dev.vhd
bcdedit /set {INSERT CSLID HERE} osdevice vhd=[C:]/VirtualMachines/Windows 7x64Ultimate/Win7x64Dev.vhd
bcdedit /set {INSERT CSLID HERE} detecthal on
It is important to mention that detecthal is used to force windows to auto detect the Hardware Abstraction Layer. At this point your work is complete. Now reboot your PC and finish installing drivers and software and you’re all set.
If later you wish to remove the boot entry you can always use the command:
bcdedit /delete {INSERT CSLID HERE} /cleanup
This deletes the specified operating system entry from the store and removes the entry from the display order.
Update 22-Nov-2009
After turning to ASPAdvice I was point to the post from Scott Hanselman titled Step-By-Step: Turning a Windows 7 DVD or ISO into a Bootable VHD Virtual Machine therefor you may want to visit what Scott had to say as well.
Recent Comments