Udostępnij za pośrednictwem


Handy Tool for Converting KVM / VMware Images to Hyper-V

I was recently involved in a conversation where people needed to convert a handful of KVM virtual machine images to Hyper-V.  Now, the QEMU project already includes the necessary tools to do this – but what if you do not have a Linux computer handy?  Well – thankfully the people over at Cloudbase Solutions have recently ported the qemu-img tool to Windows.

You can download it here: https://www.cloudbase.it/qemu-img-windows/

To use this tool to convert a KVM image to Hyper-V you just need to run:

qemu-img convert -f qcow2 "SourceDisk.img" -O vhdx -o subformat=dynamic "Destination.vhdx"

To use it to convert a VMware image to Hyper-V you need to run:

qemu-img convert -f vmdk "SourceDisk.vmdk" -O vhdx -o subformat=dynamic "Destination.vhdx"

Very useful!

Cheers,
Ben

Comments

  • Anonymous
    June 22, 2015
    Can this be used to import some older vmware vm's that are on the non current version of vmware.   Everything else needs to have vsphere to export

  • Anonymous
    June 22, 2015
    mike qemu-img supports a wide variety of formats I think, so there's a good chance. And if it doesn't, I know VirtualBox comes with its own tool (vboxmanage) that does (though I don't think it supports Hyper-V formats) so you should be able to get it converted one way or another between those two tools.

  • Anonymous
    June 22, 2015
    I like eueeno's NHC. NHC can discard filesystem free space in image file.

  • Anonymous
    December 04, 2015
    The Qemu tool as linked above worked as described! I successfuly converted a VMWare Workstation's Windows 2012 VM to one which Hyper-V is able to work with. Only issue was that I had to select 'Generation 1' during the Hyper-V creation step--Generation 2 didn't work. No biggy. Thanks for the help!

  • Anonymous
    January 30, 2016
    Hi, I have an old vmware 5 workstation archive that contains that contains disks snapshots. How can I use qemu to build a new virtual disk based on the current virtual hard disk state (it doesn't matter if i loose previous snapshot)? I have 4 linked vmdk : XPPRO_dev2.vmdk XPPRO_dev2-000001.vmdk XPPRO_dev2-000002.vmdk XPPRO_dev2-000003.vmdk and they are linked in the same order : XPPRO_dev2.vmdk CID=74d07602 parentCID=ffffffff XPPRO_dev2-000001.vmdk CID=ad2ba039 parentCID=74d07602 parentFileNameHint="XPPRO_dev2.vmdk" XPPRO_dev2-000002.vmdk CID=0dbad6c7 parentCID=ad2ba039 parentFileNameHint="XPPRO_dev2-000001.vmdk" XPPRO_dev2-000003.vmdk CID=c728cd2a parentCID=0dbad6c7 parentFileNameHint="XPPRO_dev2-000002.vmdk" So the last one is XPPRO_dev2-000003.vmdk. Does this mean that I have to convert this one to have the "current" hard disk status?

  • Anonymous
    January 14, 2017
    Could you please to add the progress by picture to convert a VM to vhd by this statement? I can not perform successfully. Thank you.