Search this site with Bing

Thursday, June 11, 2009

How to boot from VHD in Windows 7 / Windows Server 2008 R2

Booting from a Native-Boot Virtual Hard Disk (Boot from VHD) is one of the hottest features of Windows 7 and Windows Server 2008 R2.

You can follow the steps below in order to create a new Windows installation that will boot directly from a VHD:

  • Boot from the Windows 7 or Windows Server 2008 R2 DVD to start a new Windows installation
  • At the first installation dialog press Shift-F10 to start a command prompt
  • At the command prompt type diskpart
  • At the diskpart prompt type create vdisk file=c:\windows.vhd type=fixed maximum=30720 (this will create a fixed VHD of 30GBs, assuming there is this space available on the physical host disk)
  • Now run select vdisk file=c:\windows.vhd
  • Run attach vdisk
  • Exit diskpart by running exit
  • Continue the Windows installation. Ignore any warnings, such as “cannot boot from this partition”, that may appear

In case you are unlucky enough to get a blue screen during boot time, make sure you read this article to work-around it.