Jump to content











Photo

Troubleshooting OS Boot from VHD

vhd win7 thinpc wes7 embedded

  • Please log in to reply
2 replies to this topic

#1 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 05 January 2012 - 03:38 PM

VHD BOOT TROUBLESHOOTING

VHD boot problems are rare, when following exactly the Tutorials linked in this Post Signature. Most are caused by a corrupted BCD (Boot Configuration Datastore) or missing boot-critical disk & controller drivers, enabling reading the VHD or hard disk where its saved. If they occur, follow the troubleshooting steps for natively supported & unsupported OS boot from VHD:

1) install latest Windows Virtual PC (with 1024Mb+ RAM assigned), attach Win7 VHD to it as IDE disk and try to boot as hard drive. If it doesn't, it may be because of missing or errors in BCD, missing Bootmgr, mismatch of disk Sig, or incorrect partition offset set in BCD, DetectHAL element is Off or missing, missing disk driver, or volume wasn't marked Active. This may occur, since Win7 & ThinPC may lack BCD sample store in their WindowsBoot folder, resulting in wrong BCD structure when using BCDBoot command to add BCD to the new VHD. To fix, use suggested repair sequence. However, if you face 0x7B error during boot from VHD, you may need to add missing disk driver(s) entries to VHD's OS Registry, and add the driver installation packages, so that OS can autoinstall the drivers after boot. Read this and that explanation threads, and use suitable tools, like included with IMG_XP driver utilities and its collection of Registry fixes. Or, once you found missing driver INF packages, attach the VHD, mount its OS Volume to an empty folder and inject the drivers offline with DISM as per Install Unsupported OS to VHD Tutorial. If the VHD boots after that, proceed to step 2.

2) copy that Win7 VHD from HD to a bigger fixed contiguous VHD, add boot environment to the bigger VHD disk with EasyBCD or Visual BCD Editor installed on your system HD, add Win7 boot entry to it, attach the big VHD to Win VPC as IDE disk, try to boot Win7 from VHD natively inside VPC. If it doesn't, fix the big VHD's BCD using the below repair sequence. After it does, proceed to step 3, if you want test booting with Grub4DOS & WinVBlock.

3) add Grub4DOS to the big VHD, fully install WinVBlock to Win7 after booting it natively from VHD or as IDE disk inside VPC, make Win7 VHD contiguous, attach the big VHD to the Win VPC as IDE disk, try to boot Win7 VHD from it via G4D & WinVBlock menu. If errors, try to find matching versions of Grub4DOS & WinVBlock (older G4D may work well with WinVBlock - Feb. 2011, can take from wimb's IMG_XP folder). If Grub4DOS shows "File not found" error on boot, and the file name is correct in its Menu, the problem seems to be in mounting the large VHD disk. You must reboot G4D to continue tests or restore original disk mapping. Make sure to test sign WinVBlock 64-bit, and switch On Test Mode in Win7 64-bit, or use F8 at boot. Should boot... but at times WinVBlock disk may cause OS instability & file access issues after boot.

Boot troubleshooting requires some practice, so easy way to start - native boot VHDs & EasyBCD. Your findings reports are useful and appreciated, make them detail, don't miss small things. :)

#2 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 05 January 2012 - 03:52 PM

HOW TO CREATE OR REPAIR VHD BCD STORE

Pictures below show a working WES7 VHD's internal BCD Store as an example to illustrate, how to use Visual BCD Editor to open a possibly corrupted BCD Store from BootBCD inside an attached to your PC VHD disk, and try fixing it, if attempts to boot the VHD in VPC as hard disk result in BCD errors.

Fixing BCD Store with Visual BCD Editor may require some practice though... :) Or boot to Win7 VHD natively from your Windows Boot Menu, install EasyBCD inside it and repair its BCD store, MBR and PBR with EasyBCD. When you boot from that menu, Bootmgr uses the VHD Boot Entry in your host's BCD Store instead of using BCD store inside the VHD. But when you boot a VHD via Grub4DOS or attach the VHD to a VM as hard drive, its treated as a virtual hard disk (not as a filedisk), so its own BCD Store, MBR and PBR records are used during boot and must be in order.

Posted Image

Posted Image

Posted Image

Posted Image

Posted Image

Posted Image


REPAIR BCD STORE WITH VISUAL BCD EDITOR

- Boot Win7 from your host drive, attach the VHD with related to BCD boot problems, when attached to VPC as hard drive
- Make sure OS volume on VHD is marked as Primary & Active, and mount it as V: drive
- Start Visual BCD Editor, open BCD Store from V:BootBCD

1. If there is no BCD Store on the VHD:
- Select Repair Boot Record from Menu, select V: , tick Vista/7&Fix MBR --> OK,
- Select Repair BCD from Menu, BCD Drive V: , Win7 folder V:Windows --> OK
- Exit Visual BCD Editor, detach the VHD and reboot in VPC to check if the errors were fixed

2. If there is BCD Store on the VHD:
- Delete all entries under Loaders section on the Left Pan
- Click Edit Boot-Menu, delete all Boot Entries from the DisplayOrder list
- Proceed to Repair Boot Records, then Repair BCD from Menu
- Reload BCD from the VHD by selecting Open Store again from Menu
- Add any missing OS Loaders in Loaders section on the Left Pan, and rename their entries as you like
- Click on each entry on the Left Pan, and inspect its elements on the Right Pan. Make sure they make sense for the hard drive boot, are similar to a reference VHD's BCD that boots OK (GUIDs may differ), and linked to correct BCD Objects GUIDs
- Click Edit Boot-Menu, and add or edit boot entries list and display order to match Loaders list on the Left Pan
- Exit Visual BCD Editor, detach the VHD and reboot in VPC to check if the errors were fixed


REPAIR BCD STORE WITH EASYBCD

You can use EasyBCD instead of Visual BCD Editor to create or repair a BCD store:
- Install and start EasyBCD
- Select BCD Store on the VHD, using File Menu and open it

1. If there is no BCD Store:
- select BCD Deployment on the Left Pan, click Install MBR, then select partition V: --> Install BCD
- Click Add New Entry --> Windows Vista/7 --> Drive V: --> Add Entry
- Exit EasyBCD, detach the VHD and reboot in VPC to check if the errors were fixed

2. If there is BCD Store:
- select BCD Backup/Repair on the Left Pan, tick Recreate/Repair Boot Files --> Peform Action, then tick Reset BCD Configuration --> Perform Action
- Exit EasyBCD, detach the VHD and reboot in VPC to check if the errors were fixed
- If not, reattach the VHD as V: drive, open Console, run bcdboot v:windows /s v: to recreate BCD manually
- Detach the VHD and reboot in VPC to check if the errors were fixed
- If not, boot from the VHD natively from the host's Boot Menu (if its OS supports native boot from VHD), install EasyBCD and try fixing VHD BCD Store and boot sectors with it, then test boot again
- If it still doesn't boot, and you added all required boot time drivers to OS on the VHD, post the exact boot error and Windows Safe Mode driver load step, when the error occurred, in a new thread asking for help.

Have fun... :)

#3 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 06 January 2012 - 02:59 PM

For more VHD boot troubleshooting tips see also Testing Windows Embedded Standard & ThinPC 7 install and boot from VHD, where interesting results were reported by erwan.I.

To identify possible boot problems root cause, this Wiki article helps to better understand Windows NT startup process.





Also tagged with one or more of these keywords: vhd, win7, thinpc, wes7, embedded

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users