Sunday, 24 April 2016

Boot to an XP VHD from Windows 7/8/10 using bootmgr

If you have a USB-bootable Windows XP VHD, you can simply give it a .vhdboot file extension and it should boot using Easy2Boot.

But what if you want to boot an XP VHD file from a normal Windows 7/8/10 system (not grub4dos) that uses bootmgr (i.e. a standard non-UEFI Windows 7/8/10 system)?

Windows bootmgr can boot Windows 7 or later VHDs, but will not boot directly to XP VHDs.

However, you can boot automatically to an XP VHD from bootmgr, by using grub4dos as an (invisible) intermediary!


Requirements


  • Easy2BCD by NeoSmart (free version)
  • BootIce by Pauly
  • WinContig by Marco
  • a bootable VHD containing XP
  • any small .iso file (doesn't matter what it is!)
Note: This method also allows you to have grub4dos + menus, etc. or Easy2Boot on the same disk, should you wish, because it does not use \grldr or \menu.lst even though it uses grub4dos.

Procedure

I used an XP VHD that included USB support and would boot via Easy2Boot (using the .vhdboot file extension). If your XP VHD does not include USB drivers (+winvblock, etc.) then this procedure will only work for non-USB drives.

If your XP VHD only boots on USB 2.0 or IDE systems, then this procedure will only work on USB 2.0 or IDE systems (or VMs where the VHD or USB drive is attached to an IDE controller).

Drive F: is my target drive (in my case a USB HDD) which boots to \bootmgr and contains Windows 7, 8 and 10 VHDs and various WinPEs already as well as my XP VHD.


1. Use EasyBCD to create a new ISO BCD entry


Tip: Use BootIce to create a new BCD on your target drive (\boot\BCD) if you don't already have a BCD on the target drive.

Use EasyBCD to load the BCD from the target drive (File - Select BCD Store - F:\boot\BCD).

IMPORTANT: N.B. If you don't use File - Select BCD Store, you will be modifying your system PC's Windows BCD and not the target drive's BCD. If you want to add the XP VHD to your C: drive, then you don't need to use 'File - Select BCD Store'.

Now add a new entry for an ISO file (Add New Entry -  Portable/External Media - ISO) see screenshot below.

Note: Do NOT use the Disk Image (VHD) tab which is for Win7+ VHDs only and does not create a grub4dos entry.

You will need to choose an ISO - any ISO will do (use a small one because EasyBCD will make it contiguous). This ISO is just a temporary one and we are not going to use it. The ISO does not even need to be bootable (AFAIK).



Click on Add Entry to write the new entry to the F:\boot\BCD file and quit EasyBCD.

  • EasyBCD will create a file \ANG0 in the root of the F: drive and also a folder+file at \NST\AutoNeoGrub0.mbr
  • The BCD entry will actually point to the \NST\AutoNeoGrub0.mbr file which will load \ANG0.
  • The ANG0 file is in fact a modified version of grub4dos's grldr file.
Note: If you create a 2nd EasyBCD ISO entry, then \NST\AutoNeoGrub1.mbr and the file \ANG1 will be created.

2. Use BootIce to change the new ISO entry


The ANG0 (grldr) file contains an embedded menu which we can now modify so that it boots our VHD instead of an ISO:

Edit the menu in \ANG0 using BootIce - Utilities - Start Menu Editor - (open folder icon) - (change to *.*) - select \ANG0


Replace the EasyBCD menu with this one.

Now replace the ISO boot menu text with our own grub4dos VHD menu (see picture above) and save the changes. Obviously the path and name of your VHD may differ.

If you wish, you can now run BootIce - BCD Edit - Other BCD File - F:\boot\BCD - Easy Mode to change the OS Title or check the BCD entries, although it won't be seen by anyone if it is the only entry in the BCD!

BootIce shows that the BCD will load \NST\AutoNeoGrub0.mbr

3. WinContig


Finally, the VHD file needs to be contiguous. Use WinContig to make sure it is!

The boot chain!

So the boot chain sequence is:

bootmgr - BCD - \NST\AutoNeoGrub0.mbr - \ANG0 - (embedded grub4dos menu which maps VHD as hd0) - ntldr (inside VHD) - ntdetect.com (inside VHD) - boot.ini (inside VHD) - Windows XP

Please subscribe and tick one of the Reactions boxes below, if you found this useful.