Subscribe to Windows IT Pro
February 11, 2009 12:00 AM

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?

Windows IT Pro
InstantDoc ID #101457
Rating: (2)

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:\bcdbackup
bcdedit /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.vhd
bcdedit /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.

Related Content:

ARTICLE TOOLS

Comments
  • Zac
    3 years ago
    Feb 12, 2009

    Thanks very much for pointing that out, I've made the correction.

  • nagabhanukiran
    3 years ago
    Feb 11, 2009

    i think there is a slight error in these lines.

    bcdedit /set {GUID} device vhd=C:\\win7.vhd
    bcdedit /set {GUID} osdevice vhd=C:\\win7.vhd

    as i ran into errors when i tried those steps. I had checked the blog of aviraj ajgekar

    http://blogs.technet.com/aviraj/archive/2009/01/18/windows-7-boot-from-vhd-first-impression-part-2.aspx

    bcdedit /set {GUID} device vhd=[C:]\\win7.vhd
    bcdedit /set {GUID} osdevice vhd=[C:]\\win7.vhd

    this how i could get things work succesfully.

    bhanu

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.