16

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

  • Was EFI boot used on VM under Hyper-V server? – Mikhail Khirgiy Dec 12 '16 at 5:19
  • EFI was used on VM under Hyper-V – dross Dec 12 '16 at 8:12
  • One obvious thing I see is that Chipset should be set to Q35 (not i440fx) if you intend to use UEFI. – Michael Hampton Dec 13 '16 at 18:33
  • Good spot - I wasn't aware of this alternative. Tried to set the q35 in the xml file using virsh edit however virsh complained about validation on exit and would not save. – dross Dec 13 '16 at 19:15
  • Any help on how to get q35 architecture as a configurable option in virt-manager ? – dross Dec 13 '16 at 19:49
12

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
  • 1
    I tried this however I get an error so decided to use StarWind v2v Converter instead – dross Dec 13 '16 at 15:24
  • 1
    Original Post has been updated to include more detail – dross Dec 13 '16 at 17:37
  • 1
    I tried this approach again (still struggling here) with a new test Windows 2012 R2 Vm and this time there seems to be more progress than with the StarWind V2V Converter. The VM does not boot however the blue Windows Troubleshooting starts. One option is Refresh Your PC however this can't proceed since I get a message saying "The Drive where Windows is installed is locked. Unlock the Drive and try again." – dross Dec 19 '16 at 17:09
  • 1
    Ended up working out using qemu-img. Not sure why StarWind converter didn't work. – dross Dec 19 '16 at 21:40
17

What's your tool for converting? MVMC? You can also try StarWind v2v converter: https://www.starwindsoftware.com/converter It was a big help at my time. And besides, it makes identical hard drive when converts from Hyper-v. Conversion itself is performing at the block level, so all the blocks should be copied unchanged.

  • 1
    Also using StarWind v2v Converter. – dross Dec 13 '16 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.