How I converted a VMware VM to KVM

There's lots of info on the net on achieving that, but I found it a bit too scattered, and had to combine instructions from multiple sources.

I'm not certain it's the right way, but it worked™. So I'll share, and get your feedback in case I've done anything stupid:

  1. Convert VMDKs (VM's disk), even when having multiple files,  to qcow2 format (note: QVM/QEMU should be able to deal with vmdk files (multiple as well?), so possibly this step is redundant):
  2. Convert the vmx (VM's settings) to xml (requires vmware2libvirt tool found in virt-goodies package)
  3. import the xml:
  4. re-add the disk as a qcow2 disk:
    Shame on me, I did it through the GUI:

    1. Run virt-manager
    2. You should see the new VM now, cool! Open it.
    3. From the view menu, switch to 'details' mod
    4. Remove the existing (VMDK) disk, and re-add the qcow2 disk instead:
      1. Find the disk and remove it from the VM. Your probably want to make sure the checkbox for deleting the data is unchecked.
      2. Add Hardware -> Storage -> Select "managed or other existing storage" -> Browse -> choose your qcow2 file
      3. At "device type" select box, choose the proper type (IDE worked for me)
      4. At "storage format" select box, choose 'qcow2'.
      5. Click "Finish"

       

  5. Uninstall vmware

A few notes:

  • I used a very simple VM configuration (e.g. Linux, single harddisk, NAT networking, no sound)
  • I guess I lost the original snapshots

10 thoughts on “How I converted a VMware VM to KVM

  1. Roy Rothenberg

    Cool!
    What about vmtools? Removing it should probably also be a step in the process, since some/most VMWare images might contain it installed.
    And if so, does removing or not removing them have any effect on the VM's operation after the conversion?

  2. Pingback: Converting a VMware Fusion virtual machine to KVM

  3. Pingback: Converting a VMware Fusion virtual machine to KVM | MiniVirus

  4. Pingback: Booting the VMware Virtual Center SLES-11 appliance on qemu-kvm | jBlog – Systems and Application Development

  5. ferdienandp

    this is applicable to Debian/Ubuntu Linux distro only. How about Centos6/Linux ?
    vmware2libvirt - is nowhere to find and not ported to Centos.

  6. Sami Onur Zaim

    Thanks for the tutorial. It worked. I could migrate a turnkey appliance from Vmware workstation to KVM without any problems.

  7. Darren

    How long did it take to convert from VMDK to QEMU? I can't believe that nowhere is this recorded on the interwebs. Unbelievably frustrating. I understand that it will be different for all disks and underlying storage. But seriously - someone please provide anecdotal experiences in terms of "seconds per gigabyte". Wow. Has this not crossed the mind of anyone?

Leave a Reply

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