Aug 29

Windows 7 VHDSo, the question arises: how do I add a VHD of Windows 7 to the Vista bootloader? Put simply, Vista’s bootloader, not Vista, does not support booting from a VHD. Nonetheless, the bootloader can be replaced with Windows 7’s bootloader, and then we can boot from either a hard install of Vista or a VHD of Windows 7.

1. First, you will need to generate a valid VHD of Windows 7.

2. Launch a session of the Command Prompt as an Administrator (right click and select “Run As Administrator”).

First, you will need to acquire the Windows 7’s version of both bcdedit.exe and BOOTMGR. In a current Windows 7 install, BOOTMGR can be found in either (assuming C is the drive letter for Windows 7) “C:\Boot\PCAT” or “C:\” as a hidden, protected system file. Copy it somewhere. To get bcdedit.exe, go to “C:\Windows\System32″ and copy it to the same location as BOOTMGR.

To do this via the command line (copying them to a temporary folder), type in the following commands (again, assuming that C is the drive letter for Windows 7):

xcopy /H /Y “C:\Windows\System32\bcdedit.exe” “C:\Win7Temp”
xcopy /H /Y “C:\bootmgr” “C:\Win7Temp”

If Windows asks whether you have provided the directory or file name, select directory.

3. Now, boot back to the Windows Vista install and re-open the Command Prompt (this time, I’ll assume that it is Vista occupying C).

Run the following commands (or copy the files via Explorer):

xcopy /H /Y “C:\Windows\System32\bcdedit.exe” “C:\Win7Temp\Vista”
xcopy /H /Y “C:\bootmgr” “C:\Win7Temp\Vista”

4. Boot from your DVD of either Vista or Windows 7, and open the Command Prompt (press Shift+F10 on the “Install Now” page).

Run the following commands to replace your Vista bootloader with Windows 7 (make sure that you are on the root of the drive letter for Vista, such as “C:\”):

This will not work if Vista is currently running.

attrib bootmgr –s –h –r
xcopy /H /Y “C:\Win7Temp\bcdedit.exe” “C:\Windows\System32\”
xcopy /H /Y “C:\Win7Temp\bootmgr” “C:\”

5. Reboot back to Vista.

6. Now you need to add the VHD to Vista’ bootloader. To do so, run the following commands:

Leave {current} alone, but replace GUID with the identifier displayed after running the first command (should be a long series of numbers with hyphens). Also, feel free to edit “Windows 7 (VHD)” to display what you want shown in the bootloader.

bcdedit /copy {current} /d “Windows 7 (VHD)”
bcdedit /set {GUID} device vhd=[C:]\path\to\vhd\file.vhd
bcdedit /set {GUID} osdevice vhd=[C:]\path\to\vhd\file.vhd

You’re done. Enjoy your dual boot of Windows Vista and Windows 7.

 

Leave a Reply