P2V und UEFI: Quick fix

There is a known problem in converting a physical installation of Windows 2008 and 2012 with active UEFI Boot to a virtual environment (P2V). The fastest solution i found is as follows:

  1. Use Sysinternals P2V Tool and create a VHDX from your C: Drive
  2. Use a tool like Aomei Partition Assistant http://www.disk-partition.com/ (The free one only works on Desktop Editions of Windows, not Server Editions).
    1. Attach the VHDX with the Computermanagement Console to the Computer with the Partitioning tool.
    2. Open the partitioning tool
    3. Delete all partitions of your VHDX exept the actual C: Drive.
    4. Left click on the Title over the Partitions (in my case it’s labeled “Disk 5 (GPT)” an select “Convert to MBR”.
    5. Click on Apply.
  3. Detach the VHDX
  4. Create a new VM in the Hyper-V Manager (Should work with VMWare too) and attach the VHDX. Create a “Generation 1” Hyper-V VM (tested) or a “Generation2” VM and deactivate “Secure Boot” (untested).
  5. Boot the VM from a Windows 2008/2012 installation DVD.
    1. Choose “Repair your Computer”
    2. Choose “Use recovery tools…”
    3. Choose “Command Prompt”
    4. Use Diskpart to set the disk to “active”
      1. > diskpart
      2. > list disk
      3. > select disk 0
      4. > list partition
      5. > select partition 1
      6. > actice
      7. > exit
    5. Reboot and return to the command prompt
    6. Issue the following commands:
      1. > bootrec /fixmbr
      2. > bootrec /fixboot
      3. > bootrec /rebuildbcd
        1. Choose “y” for Yes
    7. Reboot from your DVD.
    8. This time the Partition should be shown. But we choose to use the Command Line instead.
      1. > cd recovery
      2. > startrep
    9. Done! Reboot whithout using the DVD. Your system should now boot up as expected.