Convert UEFI Win7/2008 R2/SBS2011 Physical Machine to HyperV Gen 1 VM

Wow, what a special case this is. This is the third time I’ve run into this issue, having to convert a workstation or server installed as a physical machine, into a HyperV VM. When installed from the factory, often techs will use UEFI — which makes for a nightmare on converting to a HyperV VM.

 

For newest OS, like Win8/10/2012, it isn’t much of an issue, for older OS, like Win7/2008R2/2011, it’s a problem, because HyperV only supports UEFI booting in Gen2. There are two parts:

  1. Converting the physical machine into a VHDX — this is easily accomplished with Disk2VHD.
  2. Converting the exported machine from a UEFI/GPT machine (Gen 2), to a BIOS/MBR machine (Gen1).

 

If you simply try loading the VHDX into a Gen 2 VM, you’ll just get a black screen with an underscore blinking and no progress. If you boot into a Gen1 VM, expect it to freeze.

This guide will cover part 2, as Disk2VHD is so simple to use it doesn’t need to be in this guide.

 

Tools

Disk2VHD – Converts Physical machines to VHDXs on a network share

AOMEI Partition Assistant Server/Technician/Unlimited – Converts VHDXs from GPT to MBR

Installation ISO matching your OS and architecture, e.g. Win 7 x32, or Server 2008 R2 x64. Once the ISO has booted, you can hit Shift+F10 at any point to open a command prompt.

 

Process

From your HyperV host, with the exported VHDX stored on your host, mount the VHDX – Right Click > Mount.

Browse to My Computer, look in the disk, make sure your content appears.

Disk Management > Detach VHD > this releases your Windows explorer file lock that would require a reboot from AOMEI.

Mount the VHDX again.

AOMEI > Select Disk > Tools > Convert GPT to MBR > Apply > Wait….

Create a Gen 1 VM in HyperV, give it enough CPU/RAM to be decent, and add a DVD drive and mount your installation disc.

Boot to CD, repair menu, nothing should be detected, or if it is, it’s at 0MB. Choose Recovery Tools > Command Prompt, or if recovery tools do not appear, hit Shift+F10 to open a command prompt.

 

Finding and Repairing the Boot Partition

We need to find the disk holding your content. Go through the drive letters until you find it, starting at C:. X: is the boot DVD.

example: C: > DIR > not Windows…. move on to D: > DIR > not Windows … G: > DIR > list populates, showing G:\Windows and G:\Users and other root folders.

 

Diskpart

list disk
#Where X is the number if your disk
Select Disk X

list volume

#Where Y is the number of your volume containing Windows
select Volume Y

list partition

#Where Z is the number of your partition containing Windows
select partition Z

#This makes the partition active -- able to be booted from and repaired by tools.
active

 

Reboot into CD, return to repair menu, if Windows offers to repair, don’t let it, just a waste of time. Open Command prompt again:

Change to your drive letter, it is most likely now C:

C:

bootrec /fixmbr

bootrec /fixboot

bootrec /rebuildbcd

Even if rebuildbcd doesn’t find an installation, “0 Windows installations found”, somehow it still seems to have an effect on the boot process succeeding, I’ve seen “0 installations found” machines become bootable. Other times, you need to create the BCD store.

 

Reboot, return to repair > command prompt

browse to your drive again, most likely C:

C:
dir
#if Windows shows up..... run
bcdboot C:\Windows

Your boot information will be rebuilt. Remove the CD, start the VM, watch in amazement as the Gen1 boot turns on. You will likely need to use the HyperV Integration Services disc for drivers to work, allowing for network connectivity and higher resolutions.

 

Hoping that gets you on the right track, good luck!

Leave a Reply

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