Converting Windows 2012 R2 from Hyper-V to KVM (qemu)

kvm-virtualizationwindows-server-2012-r2

I have a Windows Server 2012 R2 running SharePoint 2013 which I am trying to migrate from Hyper-V to KVM (qemu). I have converted the vhdx file to qcow2 format
and copied it across to the KVM server (RHEL 7.3)

The Hyper-V VM was configured as Generation 2 and I have create a new VM in KVM with a UEFI firmware (OVMF).

When I boot up the machine goes in to Automatic Repair mode but will not boot. I can open the Cmd Prompt and to do so I need to authenticate with the local Administrator password.

I have run the following:

  1. Type BOOTREC /FIXMBR, and then press ENTER.
  2. Type BOOTREC /FIXBOOT, and then press ENTER.
  3. Type Drive:\boot\Bootsect.exe /NT60 All, and then press ENTER.

However the VM is unable to boot always enters Repair mode.

Any suggestions on what I might need to check or any 3rd party utilities I might be able to use or buy to help me easily get past this ?

If I login to command prompt I can run Diskpart / sel disk 0 / list vol to see :

Volume 0    D          CDROM          0 B   No Media
Volume 1    C NTFS     Partition    126GB   Healthy
Volume 2    E Recovery Partition    300MB   Healthy   Hidden
Volume 3               Partition     99MB   Healthy   Hidden

VM on KVM was configured as:

*Emulator:/usr/libexec/qemu-kvm
*Firmware:UEFI x86_64:
*/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd
*CPUs 8
*Memory 8192MB
*IDE DISK- Disk Bus IDE
*Storage format qcow2

What I have done so far:

  1. Opened Hyper-V and Exported the VM to a new directory on Windows
  2. Use Hyper-V Inspect Disk to merge the difference avhdx and vhdx disks into one vhdx
  3. Used StarWind v2v Converter to create a qcow2 file
  4. Copied the qcows file to KVM machine
  5. Create new VM of same spec:

enter image description here
enter image description here
enter image description here
enter image description here
enter image description here
enter image description here
6. When starting the new machine I see this:

enter image description here

Best Answer

This this

yum install qemu-img

First, check the file, make sure it’s ok.

qemu-img check -r all rmcjmc01.vhdx

If ok, convert the file

qemu-img convert -O qcow2 rmcgmc01.vhdx rmcgmc01.qcow2