Repair unable to boot VM after a successful P2V with NovaBACKUP and BCDBoot (for Windows 7, 8, 10, Server 2008, 2008 R2, 2012, 2016)
NovaBACKUP
Last Updated: May 03, 2018 01:02PM PDT
Repair unable to boot VM after a successful P2V with NovaBACKUP and BCDBoot (for Windows 7, 8, 10, Server 2008, 2008 R2, 2012, 2016).
This guide is for those that want to repair a non-bootable VM created with the P2V method of Image Backup to VHD (Microsoft Virtual Hard Drive) using the bcdboot.exe command which is native to pretty much all editions of Windows. With this method you DO NOT need to have or use the installation media CD/DVD or .ISO image or the Windows PE boot disc to repair a non-bootable VM. BCDBoot can copy boot environment files from the host OS if the host OS where the .VHD file exists is a compatible OS being Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2, or Windows Server 2008. The BCDBoot command will be issued from the Windows Hyper-V Hypervisor server where the VHD file exists currently, you will be using the native VHD mount capability of the host OS and then issue the appropriate BCDBoot command line statement to replace the boot environment files on the mounted VHD via the installed Windows image to the system partition contained in the VHD.
1. First you will need to mount a non-bootable Virtual Machine .VHD image via the Windows Hyper-V Hypervisor machine by right-clicking on the .VHD (or.VHDX) and then clicking on "Mount". The partitions contained in the VHD will be mounted with write access to allow for the replacement of the boot-environment files there. Note: If you receive the error "Sorry, there was a problem mounting the file", when attempting to mount the VHD then I would suggest restarting the computer now and then try this step again. You can also perform an Attach VHD function via the Disk Management tool (the command is "diskmgmt.msc") which is built in to Windows, as it is better at displaying information / messages in that tool, for instance you could be attempting to mount an already mounted VHD image and if so when using the Disk Management tool will tell you "The virtual disk is already attached", instead of the generic "There was a problem mounting the file" error that the right-click Mount method would show you if this were the case. Note: If you use the Attach VHD function in Disk Management make sure that you do not enable the checkbox labeled as "Read-only." as enabling that option will not allow the write access that is required for the next steps, to be able to repair the boot-environment files that exist in this non-bootable Virtual Machine .VHD image that you are working with.
2. Take note of the additional new drive letters that were mapped by performing the mount command in Step 1. We will show two example scenarios. In the first example we mount a Windows Server 2012 based VHD image and two new drive letters are mounted, the first is F: drive which is the System Reserved partition and the second is G: drive which is the main Windows partition in the VHD. The System Reserved partition is a special partition that you will see on some systems, whereas other systems will not contain that extra System Reserved (F: drive) partition, so take note of this. In this example the boot records will be written to the System Reserved F: drive partition, and the source files for where the boot records will be created from exist on the G: drive. If after mounting your VHD only one new drive letter is mounted, then skip down to the example in Step 5 and start from that step.
3. Launch an Admin Command Prompt and switch to the drive letter of the Windows partition that was contained inside the VHD image, like G: for this example, so that G:\Windows\System32 will display at the prompt.
4. Issue the command: bcdboot G:\Windows /s f:
After issuing the above command, the command line output needs to display “Boot files successfully created”. This will add the boot entry and allow you to boot the VM.
5. In the second example we mount a Windows 10 based VHD image and only one new drive letter is mounted, this is the G: drive which is the main Windows partition in the VHD.
6. Issue the command: bcdboot G:\Windows /s g:
7. Exit the Command Prompt session by closing the Command Prompt window by clicking on the X at the top right of the window or by typing the word 'exit' in to the Command Prompt, and then click enter and the Command Prompt window that was open should close.
8. Eject the mounted virtual drive(s) that the mount command performed (when you right-clicked on the .VHD/.VHDX file and told it to Mount), in this example it was G: drive, right-click on G: drive and then click on “Eject” to dismount the currently mounted VHD. If you have more than a single volume that was mounted as a virtual drive then go ahead and right-click on the other volumes and eject them.
9. Boot up the VM in question and it should display a boot selection menu, the default selected entry is the entry that was inserted with the bcdboot command and that default entry should allow the VM to boot up. Choose the default entry from the list and press 'enter' to boot the VM.
You are now either booting into Windows, or you are not. Note that it may take up to an hour to actually get to the Windows login screen when booting the VM properly for the first time as new hardware is discovered at start up since you converted a physical machine to virtual machine this is where that new hardware is discovered by Windows. The second time you boot this VM it should be much faster!
10. If you need to make changes to the boot selection choices, example you want to remove an old duplicate entry that doesn't work anymore, you can do so by starting the VM and logging in to Windows and then go to Start > Run > MsConfig > Boot. The boot entries are listed there and can be manipulated with "Delete" and "Set as default" functions.
Further Information:
How to use the BCDBoot.exe tool in the Windows Recovery Environment to troubleshoot and repair startup issues in Windows
-and-
BOOTMGR is missing - Repairing a Windows 7 or 2008 R2 image after VM deployment
http://itproctology.blogspot.com/2010/04/bootmgr-is-missing-repairing-windows-7.html
-and-
How to use the Bootrec.exe tool in the Windows Recovery Environment to troubleshoot and repair startup issues in Windows
http://support.microsoft.com/kb/927392
View all NovaBACKUP related P2V articles here.