Q. How do I dual boot an existing OS with Windows 7 or Windows Server 2008 R2 installed in a virtual hard disk (VHD) file?
February 10, 2009
A. If you already have a VHD containing Windows 7 or Server 2008 R2 that you want to boot on a physical machine that already has Windows 7 or Server 2008 R2, you can add the VHD file to the boot menu. Make sure that the VHD file doesn't have the Virtual PC or Virtual Server Virtual Machine Additions, but the Integration Components used by Hyper-V aren't a problem and are part of the Server 2008 R2 and Windows 7 OSs anyway.
You need to prepare the VHD OS for the change in hardware from a virtual to a physical environment using the following Sysprep command:
sysprep /generalize /oobe /shutdown
You can now copy the VHD file to the root of your boot partition and add it to your boot configuration data (BCD). Use the following commands to copy the existing {default} BCD entry to a new entry, then tell that new entry to point to the copied VHD file:
bcdedit /export c:bcdbackupbcdedit /copy {default} /d "VHD Win 7 Boot"
The above commands will return a GUID for the new entry. You'll need to use the GUID in the following commands.
Update:Corrected these commands.
bcdedit /set {GUID} device vhd=[C:]win7.vhdbcdedit /set {GUID} osdevice vhd=[C:]win7.vhd
You can use the same method if you want to install an OS onto a blank VHD.
Related Reading
Videos:
Audio:
Check out hundreds more useful Q&As like this in John Savill's FAQ for Windows. Also, watch instructional videos made by John at ITTV.net.
About the Author
You May Also Like