Check out all reviews and tips about Windows 7 on 4sysops.

In my last article, I described the different methods you could use to create a Windows 7 VHD. The next step is to add the VHD to the boot manager of the physical machine. This is quite easy if the computer runs Windows 7. If you want to dual boot Windows Vista, things are a bit more complicated because Vista’s boot manager (bootmgr) doesn’t support VHDs. You can skip the following procedure if your host has Windows 7 installed.

Note: I can’t guarantee that you won’t mess up your Vista installation this way. It’s not really an official procedure and probably not supported by Microsoft. However, it worked for me and you will find several other blogs with similar descriptions. You should make a backup before you proceed.

First, you have to replace two files on your Vista machine with the corresponding Windows 7 files: bootmgr and bcdedit.exe.

The boot manager bootmgr is a hidden operating system file in the system drive’s root folder. I recommend making a copy of bootmgr before you replace it. You have to configure Windows Explorer’s folder options first to make it visible (see screenshot). The Windows 7 version of bootmgr can be found under C:\Windows\Boot\PCAT\.

bcdedit.exe is the tool you will need to add the entry to the boot menu. Vista’s bcdedit doesn’t support VHD devices. That’s why we need the Windows 7 version. You can find the tool under C:\windows\system32\. Don’t forget to also make copy of the Vista version first.

It is not possible to replace system files of a running Vista machine. At least, I don’t know how to do this. Therefore, you have to boot Windows RE from a Vista DVD and replace bcdedit.exe and bootmgr on the recovery console. Make sure that you have copied the Windows 7 version of bcdedit.exe and bootmgr first to a temporary folder on the Vista machine.

On the recovery console you can replace bcdedit with xcopy:

xcopy c:\temp\bcdedit.exe c:\windows\system32

You have to remove the “read only” attribute before you can overwrite bootmgr:

attrib bootmgr –s –h –r

“-s” and “-h” are needed because bootmgr is a hidden system file.

You can now copy the Windows 7 version of bcdedit.exe from the temporary folder:

xcopy c:\temp\bootmgr c:\

Next, you can restart Vista. Hopefully the new boot manager will work.

Adding the VHD to the boot menu is the last step before you can boot Windows 7 from a VHD. Basically, it works the same way as adding a physical drive to a boot entry. First, you have to launch an elevated command prompt; then, you have to make a copy of your current boot entry with the bcdedit command:

1. bcdedit /copy {current} /d “Windows 7 VHD”

“Windows 7 VHD” is the name of the new boot entry in this example. Now you have to set the entry option value for this boot entry with the following two commands:

2. bcdedit /set {f5fd5b9e-0cd7-11de-b4be-000c29ebc1bc} device vhd=[C:]\vhd\win7.vhd

3. bcdedit /set {f5fd5b9e-0cd7-11de-b4be-000c29ebc1bc} osdevice vhd=[C:]\vhd\win7.vhd

The long number in braces is the identifier of the boot entry. It will be displayed after you entered the first command. You also have to replace “[C:]\vhd\win7.vhd” with the location of your own VHD file. Don’t forget the brackets.

You can now reboot and select “Windows 7 VHD” from the boot menu to run Windows 7 from VHD. If you need more detailed instructions, I recommend Aviraj Ajgekar articles about this topic.