Boot from VHD (Windows 7 and/or Server 2008 R2)

Windows 7 Boot from VHD

One of the new features in Windows 7 and Windows Server 2008 R2 is the ability to boot from a VHD. This allows for the use of multiple operation systems on a single computer (like when using Virtualization) however it has much better performance as the OS boots natively.  The great part is that it is pretty simple to enable this feature and have it ready at your disposal!  Before you begin you should note the following…

·         You can only boot a Windows 7 or Windows Server 2008 R2 VHD

·         You must configure the boot editor from a Windows 7 or Server 2008 R2 install

·         You cannot use a Virtual PC VHD, I suggest a Hyper-V VHD

·         You need to start with a clean slate, don’t try and reuse an old VHD

Start by launching a Command Prompt and be sure to run as Administrator, once that is done run the following commands…

bcdedit /copy {current} /d “Boot From VHD (put any name here)”

Copy the CSLID that is displayed and then run…

bcdedit /set {CLSID} device vhd=[C:]vhdname.vhd

bcdedit /set {CLSID} osdevice vhd=[C:]vhdname.vhd

bcdedit /set {CLSID} detecthal on

You can replace [C:]vhdname.vhd with the path and name of your VHD.

Once that is complete reboot and you will have the option to “Boot_From_VHD”!  You can verify the bootloader is configured correctly with the bcdedit command which will list all the boot options.  If you want to delete the entry make note of the GUID listed in bcdedit and use the following command…

bcdedit /delete {GUID} /cleanup

For more information be sure to check out the Windows 7 resource page on Technet.com

Some other useful links:

http://blogs.msdn.com/b/knom/archive/2009/04/07/windows-7-vhd-boot-setup-guideline.aspx