{"id":347,"date":"2012-04-30T14:29:50","date_gmt":"2012-04-30T11:29:50","guid":{"rendered":"http:\/\/www.held.org.il\/blog\/?p=347"},"modified":"2013-03-20T01:37:09","modified_gmt":"2013-03-19T22:37:09","slug":"how-i-converted-vmware-vm-to-kvm","status":"publish","type":"post","link":"http:\/\/www.held.org.il\/blog\/2012\/04\/how-i-converted-vmware-vm-to-kvm\/","title":{"rendered":"How I converted a VMware VM to KVM"},"content":{"rendered":"<p>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.<\/p>\n<p>I'm not certain it's the right way, but it worked\u00e2\u201e\u00a2. So I'll share, and get your feedback in case I've done anything stupid:<\/p>\n<ol>\n<li><strong>Convert VMDKs<strong> (VM's disk)<\/strong>, even when having multiple files,\u00c2\u00a0 to qcow2 format<\/strong> (note: QVM\/QEMU should be able to deal with vmdk files (multiple as well?), so possibly this step is redundant):\n<pre># qemu-img convert <vmdk wildcard> <qcow2 file><\/pre>\n<\/li>\n<li><strong>Convert the vmx (VM's settings) to xml (requires vmware2libvirt tool found in <em>virt-goodies<\/em> package)<\/strong>\n<pre># vmware2libvirt -f <source.vmx>\u00c2\u00a0> target.xml<\/pre>\n<\/li>\n<p><!--more--><\/p>\n<li><strong>import the xml<\/strong>:\n<pre># virsh -c qemu:\/\/\/system define file.xml<\/pre>\n<\/li>\n<li><strong>re-add the disk as a qcow2 disk<\/strong>:<br \/>\nShame on me, I did it through the GUI:<\/p>\n<ol>\n<li>Run virt-manager<\/li>\n<li>You should see the new VM now, cool! Open it.<\/li>\n<li>From the view menu, switch to 'details' mod<\/li>\n<li>Remove the existing (VMDK) disk, and re-add the qcow2 disk instead:\n<ol>\n<li>Find the disk and remove it from the VM. Your probably want to make sure the checkbox for deleting the data is unchecked.<\/li>\n<li>Add Hardware -&gt; Storage -&gt; Select \"managed or other existing storage\" -&gt; Browse -&gt; choose your qcow2 file<\/li>\n<li>At \"device type\" select box, choose the proper type (IDE worked for me)<\/li>\n<li>At \"storage format\" select box, choose 'qcow2'.<\/li>\n<li>Click \"Finish\"<\/li>\n<\/ol>\n<p>&nbsp;<\/li>\n<\/ol>\n<\/li>\n<li>Uninstall vmware<\/li>\n<\/ol>\n<p>A few notes:<\/p>\n<ul>\n<li>I used a very simple VM configuration (e.g. Linux, single harddisk, NAT networking, no sound)<\/li>\n<li>I guess I lost the original snapshots<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>There&#8217;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&#8217;m not certain it&#8217;s the right way, but it worked\u00e2\u201e\u00a2. So I&#8217;ll share, and get your feedback in case I&#8217;ve done anything stupid: Convert VMDKs (VM&#8217;s disk), even when [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[198,183,182,184,180,128,181],"_links":{"self":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts\/347"}],"collection":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/comments?post=347"}],"version-history":[{"count":0,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/posts\/347\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/media?parent=347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/categories?post=347"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.held.org.il\/blog\/wp-json\/wp\/v2\/tags?post=347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}