How to add a Windows 7 VHD to Vista’s boot manager menu

Michael PietroforteMVP By Michael Pietroforte - Tue, March 24, 2009 - 8 comments google+ icon

Michael Pietroforte is the founder and editor of 4sysops. He is a Microsoft Most Valuable Professional (MVP) with more than 30 years of experience in system administration.

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.

-1+1 - Rate this post
Loading ... Loading ...
Disclaimer
Your question wasn't answered? Please ask in the new 4sysops forum!

8 Comments- Leave a Reply

  1. Daniel Mundy says:

    This sounds really interesting. I’m using Windows 7 on my laptop and would love to have a Vista VHD and boot to that.

    Would it be possible to install XP in a VHD and do this too…?

  2. anoymuos says:

    From what I understand, this VHD booting feature should any boot any OS that’s HAL independent. So if a Windows Vista or Windows 7 image is sysprepped/generalized and booted, it should detect the real PC hardware and work! Can you test this? Also, if this feature is exclusive to Windows 7 Ultimate/Enterprise, how can they prevent users from simply copying the Ultimate bootmgr and bcdedit.exe to lower SKUs to “get” the feature?

  3. I didn’t try it, but I doubt somehow that it works with other Windows version than Win7. I think this is not only a feature about the boot manager, but of the operating system itself. It has to recognize the VHD as a bootable disk. Let me know if I am wrong.

  4. Cesare Auteri says:

    Great Tip!!! I’m now working on Windows 7 booted from VHD. Base system is still Vista x64.
    Only thing not working is Windows Experience Index :-P

  5. Terry says:

    After all this, when windows gets to the setup part on the VHD it craps out with a message about my Licenses and says VHD is NOT supported on this syste. It would not accept my licenses number and I had to leave that field blank.

  6. Kishore B says:

    Sameer Dhoot has a very detailed step by step instructions with screen shots on how to replace the Windows Vista bootloader with Windows 7 bootloader giving you the ability to boot from VHD. read the post here http://intellects.in/2009/10/23/boot-from-vhd-replacing-vista-or-windows-2008-bootloader-with-windows-7-bootloader

  7. Daren says:

    With Portlock Leap Frog, you can setup a preconfigured VHD with Windows XP or Windows Vista. Portlock Leap Frog will upgrade the boot manager to support VHD boot. A dual boot configuration between XP or Windows 7 on the same partition is possible.

    http://www.portlock.com/support/knowledge_base/download_windows_7_vhd.aspx

  8. stylemessiah says:

    @7
    I think most people will go with a solution that doesnt cost $39.95 …

    Got shares in it have you? Or just work for them?

Please share your thoughts in a comment!

Login

Lost your password?