If you try to run a physical-to-virtual (P2V) conversion on a Windows Server 2012 R2 machine with UEFI, you’ll receive the error “There is no BCD boot device found in the source machine, noticing that the conversion of an EFI boot machine is currently not supported.” In this article, I’ll show you how to bypass that error by converting the server to a VM with Disk2vhd and how to repair the boot record so you don’t get a black screen with a blinking cursor.

Recently, I needed to convert a physical Windows Server 2012 R2 server to a virtual machine (VM). When the server was deployed, it was configured with UEFI. I downloaded the Microsoft Virtual Machine Converter and ran through the process to start the conversion of the machine after hours. When I got to the very end of the wizard, I received this error: “Microsoft Virtual Machine Converter encountered an error while attempting to convert the virtual machine. Details: There are blocking issues for the physical-to-virtual conversion: There is no BCD boot device found in the source machine, noticing that the conversion of an EFI boot machine is currently not supported.”

Microsoft Virtual Machine Converter encountered an error while attempting to convert the virtual machine

Microsoft Virtual Machine Converter encountered an error while attempting to convert the virtual machine.

Unfortunately, the Virtual Machine Converter doesn’t support P2V conversions for UEFI computers with GPT disks such as this server. Backing up all the data and performing a full server migration is an option. However, this particular server just had the application on it upgraded. In addition, a full migration would have been very time consuming, especially considering that the specialty application required hours of vendor assistance to install.

Convert the disk to VHDX

The first thing that we need to do is convert the physical disk to VHDX. A great Sysinternals tool from Microsoft called Disk2vhd will perform this task. Download Disk2vhd and extract the executable on the server that needs to be converted. Run the application, set the location where you want the VHDX file stored, and click Create.

Convert the disk to VHDX using Disk2vhd

Convert the disk to VHDX using Disk2vhd.

For the VHD file name, I used a UNC path to a temporary storage location that had enough storage to store all the data from the server. After the process completes, transfer the VHDX file to a Windows 8+ workstation.

Convert the disk from GPT to MBR

Next, we’ll need to convert the disk from a GPT disk to an MBR disk. A few different ways exist to do this (including the built-in tools in Windows), but I’ve found that using AOMEI Partition Assistant is, by far, the most reliable way to perform the conversion. In most cases, the Standard edition (that is free) can do everything you’ll need as long as you run it from Windows 8+ and not a server. If you’re working with very large partitions, you may need to pay for the Professional edition.

Using a Windows 8+ computer, mount the VHDX file by right-clicking it and choosing Mount.

Mount the VHDX file in File Explorer

Mount the VHDX file in File Explorer.

Make note of the drive letter that is assigned to the disk after it is mounted. In my case, it was H:\.

View the mounted VHDX file as a drive letter in File Explorer

View the mounted VHDX file as a drive letter in File Explorer.

Next, open AOMEI Partition Assistant and find your disk. Right-click the disk where it shows Disk Number (GPT) and then choose Convert to MBR Disk.

Convert GPT disk to MBR in Partition Assistant

Convert GPT disk to MBR in Partition Assistant.

Accept the warning messages and then click Apply in the upper-left corner to apply the changes. Next, right-click each of the extra partitions at the beginning of the disk and choose Delete Partition.

Remove extra partitions in Partition Assistant

Remove extra partitions in Partition Assistant.

Choose the default option, Delete partition quickly, and then click OK for each. Click the Apply button one last time to apply the change. After the process completes, close Partition Assistant.

Last, you’ll need to disconnect from the VHDX file. Go to File Explorer, right-click the mounted VHDX file, and choose Eject.

Eject the VHDX file in File Explorer

Eject the VHDX file in File Explorer.

Create the new virtual machine

In Hyper-V Manager, run through the normal steps to create a new VM. When creating the VM, make sure that you choose a Generation 1 VM and, instead of creating a new VHDX file, attach the file that was generated by Disk2vhd that we’ve edited.

Assuming you’ve done everything correctly so far, you should be greeted by a black screen with a blinking cursor if you attempt to start the VM that never boots into Windows.

Disk2vhd converted Server 2012 R2 with blinking cursor that won't boot

Disk2vhd converted Server 2012 R2 with blinking cursor that won't boot

Repair the virtual machine

To repair the VHDX so it will boot into Windows Server 2012 R2, we’ll need a Windows Server 2012 R2 install ISO image. Attach the ISO to the VM and boot from the ISO/virtual DVD drive. On the first Windows Setup screen, click Next, and then click the Repair your computer link.

Windows Server 2012 R2 Setup Repair your computer

Windows Server 2012 R2 Setup Repair your computer

Click the Troubleshoot option and then click Command Prompt.

Command Prompt in Advanced Options of Troubleshooting

Command Prompt in Advanced Options of Troubleshooting

Next, we’ll use diskpart to make the partition on the VHDX active. At the command prompt, run the following commands:

diskpart 
list disk 
select disk 0 
list partition 
select partition 1 
active 
exit

Use diskpart to make the partition active

Use diskpart to make the partition active.

Depending on your configuration, you may need to adjust the disk and partition numbers. After setting the partition as active, reboot the VM and boot to the Windows Server 2012 R2 setup ISO again. Run through the same process we used in the last step to get to the command prompt again.

Next, we’ll use bootrec to make the VHDX bootable. At the command prompt, run the following commands:

bootrec /fixmbr 
bootrec /fixboot 
bootrec /rebuildbcd

Use bootrec to make the VHDX bootable

Use bootrec to make the VHDX bootable.

After the final command completes, you’ll be asked if you want to add the installation to the boot list. Type “y” and press Enter. Detach the Windows Server 2012 R2 ISO and reboot the system.

Boot Windows Server and clean up

After rebooting, you should be greeted by a familiar-looking boot screen while Windows adjusts to its new virtual hardware.

Windows Server 2012 R2 Getting devices ready after Disk2vhd and repair

Windows Server 2012 R2 gets devices ready after Disk2vhd and repair.

The last thing we’ll need to do is some cleanup of things the physical server needed that the virtual server won’t need. Open Device Manager and click View, then Show hidden devices.

Show hidden devices in Device Manager

Show hidden devices in Device Manager.

When you expand the different hardware sections in Device Manager, you should now see phantom hardware that has a lighter icon than the existing hardware.

Phantom physical hardware in Device Manage for P2V system

Phantom physical hardware in Device Manage for P2V system

For each of the phantom pieces of hardware, you’ll need to right-click and choose Uninstall to remove it.

Next, you’ll need to go to Program and Features in the Control Panel and remove any vendor-specific software such as NIC teaming tools or hardware management software. Once you’ve done that, reboot the server, re-attach the network adapter to the network, and you’re ready to use your new VM.

avataravatar
55 Comments
  1. Andrew 8 years ago

    Hi,
    Thanks for sharing this guide.
    I follow your steps but still i’m getting an error trying to boot windows. No boot found.
    Any help/suggestions?

    Thanks

  2. Eddie 7 years ago

    Genius. Thanks so much for posting this. Followed your instructions to the letter and resolved my problems. Many thanks.

  3. Rune 7 years ago

    Many thanks for the article but what if the partition is too large for MBR hence why it is GPT in the first place.

    • Author
      Kyle Beckman (Rank 2) 7 years ago

      Then you’ll either need to shrink the partition and move your data to another disk or create a new VM and migrate the services and data.

  4. Eric 7 years ago

    After a few hours of searching and trying different things your tutorial was the only one that worked without a hitch. Thank you!

  5. MarkoS 7 years ago

    Thank you very much, very helpful to me !!!

  6. ewash 7 years ago

    Hi, very nice, thank you. This may come also handy once you want to convert your Hyper-V Gen2 machines to Azure. But I rather first convert and remove system reserved and EFI partition via VmWare converter, and then convert to vhd.

    • Author
      Kyle Beckman (Rank 2) 7 years ago

      It really is up to how many partitions you have. If you have split up your VHD into multiple partitions, you have to do it my way. Personally, I prefer removing anything I can before P2V to cut down on the conversion time.

  7. jason 7 years ago

    Hello does this work if the source  server is  2008 R2

    • Author
      Kyle Beckman (Rank 2) 7 years ago

      I was specifically trying to P2V Server 2012 R2… Your mileage may vary if you’re using 2008 R2.

  8. jason 7 years ago

    After deleting the partitions through AOMEI it gave me 222 MB of free space at the beginning of the disk ? Should  i merge this into the system partition ?

  9. Burobin 7 years ago

    Thanks a lot for sharing, it helped a lot!

     

    Just one comment, that was valuable in my case: after all changes, i was getting “A disk read error occurred” during boot. The error went away, when I included the empty space at the beginning to the volume. Maybe the good old 1024 cylinder limit somehow affected my case.

    • Ivo 7 years ago

      How did you include the empty space in to the partition? I can’t figure out how AOMEI Partition Assistant can do it.

  10. Jacob 7 years ago

    Thank you, worked great!

  11. elias 7 years ago

    great. thanks.

  12. Qua T. 7 years ago

    If you get stuck, try bcdboot c:\windows

  13. Asmi 7 years ago

    Perfect!!! It worked for me… Very helpful… Thanks a lot !!!

  14. Rishabh 7 years ago

    hi,

    i have tried above given steps but after running the fixmbr command, and restart the VM but not booting in OS and Blue dump is coming..

    can u please help me on this case?

  15. bJako 7 years ago

    Tx, best guide ever.

  16. HarryM 6 years ago

    Kyle,

    Would this work for Windows 2008 R2 Enterprise Edition? We have a server with a single 4TB C:\ drive that contains the OS. The server is DC, RDP, DNS, DHCP and file server. It was made in the days where hyper-v was not 100% and the partition was this big so as to accommodate two different sites merging into one.

    Virtualizing may allow for eliminating, say DC while keeping RDP. We do have a backup domain controller.

    Given the above roles, assuming the machine above will become a Backup domain controller prior to P2V, does it make sense?

    • Author
      Kyle Beckman (Rank 2) 6 years ago

      In this case, I’d stand up a new VM (or VM’s since there are multiple servers) and migrate all the services.  There’s way too much running on that one system and running a P2V sounds like a nightmare waiting to happen.

  17. Gregg Hamilton 6 years ago

    Why is the conversion to MBR needed? Converting to MBR is not an option in my case. Is it just that existing conversion tools don’t support it? In theory, would it be possible to write my own P2V tool that could produce a bootable GTP VHDX?
    Thanks,
    Gregg

  18. Uwe 6 years ago

    Thanks a lot for this very helpful guide! Following it, I was eventually able to boot my converted VM after many unsuccessful attempts before.

  19. Luke 6 years ago

    I am in the process of converting an GPT VHD image to MBR.

    When I started Aomei converting to MBR, it immediately failed to do anything, claiming another process was using the volume. Then wiped out the entire partition structure!  Most reliable way my ass. Just a heads up for anyone else doing this… Make sure you have a backup before you touch anything with Aomei.

  20. WoodyNZ 6 years ago

    Nice Work. This was exactly what I needed and it worked like a charm

  21. Valdenir 6 years ago

    Show, perfect.

  22. G Stern 6 years ago

    Exactly how to attach the ISO – this took me a little digging around.  It’s in the Settings of the VM itself.
    Increase RAM to 1024 MB (in the Settings of the VM).  When I had it at the default of 512MB, I could not boot from the ISO into Troubleshooting, it would crash after selecting US Keyboard layout.  I still need to set the dynamic RAM the next time my VM is down.  Right now it boots slow and pounds my page file disk.
    I really appreciate this well-written article with good screenshots.  Nice job!  it took me a few attempts over a few days, but it spun up this morning!

  23. G Stern 6 years ago

    Also: I had to store the VHDX on a separate drive.  There were other things I had to tinker with as well.  And I’ll never know exactly which tweaks were effective.  I was about to give up.  But I got it – and you can too – hang in there!

  24. SeattleITPro 6 years ago

    I had to modify the process a bit with a Windows Server 2008R2 machine, but this article pointed me in the right direction.

    AMOEI wasn’t able to convert my GPT virtual disk to MBR because it was locked or something. I worked around that by creating a new MBR-based virtual disk and using copy partition in AMOEI to copy from the GPT virtual disk over to the fresh MBR virtual disk.
    This info helped me resolve a missing BOOTMGR issue: https://support.microsoft.com/en-us/help/2622803/bootmgr-is-missing-press-ctrl-alt-del-to-restart-error-when-you-start-windows.
    Blue screen stop errors (0x0000007B) are likely due to the mass storage driver that was in use on the physical server. I was able to resolve the blue screen using this information: http://www.justandrew.net/2009/10/stop-0x0000007b-on-p2vd-windows-7.html and https://blogs.technet.microsoft.com/michs/2011/09/16/p2v-migration-issues-with-hyper-v-stop-0x0000007b/.

  25. jj 6 years ago

    Good stuff broski! You saved me alot of time.

Leave a reply to Gregg Hamilton Click here to cancel the reply

Please enclose code in pre tags

Your email address will not be published. Required fields are marked *

*

© 4sysops 2006 - 2023

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account