Saturday, March 21, 2009

Allow boot from VHD on Windows Vista

The main change for just booting form VHD file is the new boot manager for Windows 7 which allow mounting VHD as hard disk,so if you need to allow the same feature while you are still using Vista so you can change the boot manager only.

To do so, you have to unhide and replace bootmgr which located on the root of your vista drive and the bcdedit.exe which located under \windows\system32\

To unhide

attrib -h -r –s c:\bootmgr
attrib -h -r -s c:\windows\system32\bcdedit.exe
To replace 

Find these files from Installed Windows 7 or 2008 R2, then you can use the commands below to add your VHD as Bootable option.

C:\>bcdedit /copy {current} /d "My New VHD Description" 
C:\>bcdedit /set <guid> device vhd=[driveletter:]\<directory>\<vhd filename> 
C:\>bcdedit /set <guid> osdevice vhd=[driverletter:]\<directory>\<vhd filename> 
C:\>bcdedit /set <guid> detecthal on