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:
- 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):
1# qemu-img convert <vmdk wildcard> <qcow2 file> - Convert the vmx (VM's settings) to xml (requires vmware2libvirt tool found in virt-goodies package)
1# vmware2libvirt -f <source.vmx> > target.xml - import the xml:
1# virsh -c qemu:///system define file.xml - re-add the disk as a qcow2 disk:
Shame on me, I did it through the GUI:- Run virt-manager
- You should see the new VM now, cool! Open it.
- From the view menu, switch to 'details' mod
- Remove the existing (VMDK) disk, and re-add the qcow2 disk instead:
- Find the disk and remove it from the VM. Your probably want to make sure the checkbox for deleting the data is unchecked.
- Add Hardware -> Storage -> Select "managed or other existing storage" -> Browse -> choose your qcow2 file
- At "device type" select box, choose the proper type (IDE worked for me)
- At "storage format" select box, choose 'qcow2'.
- Click "Finish"
- 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
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?
Good point. I'd guess it can be removed, on the other hand leaving it shouldn't cause any problem.. But it's just a hunch.
Plus this link suggests removing it:
http://www.linux-kvm.org/page/How_To_Migrate_From_Vmware_To_KVM
Pingback: Converting a VMware Fusion virtual machine to KVM
Pingback: Converting a VMware Fusion virtual machine to KVM | MiniVirus
This was really a terrific entry and I appreciated it a lot. One additional item is that if the guest in question is a Windows machine, then there may be more steps. I found this article here that helped with that:
http://riaschissl.blogspot.com/2009/06/not-so-easy-migration-from-vmware.html
Pingback: Booting the VMware Virtual Center SLES-11 appliance on qemu-kvm | jBlog – Systems and Application Development