Guest post: Converting VMware guests to libvirt/KVM guests

This is a guest post by Marko Myllynen.

VMware guests can be converted as Libvirt/QEMU/KVM guests without any need for proprietary VMware tools. There are two ways to do the conversion, use the one appropriate for your environment.

Converting On-Disk VMware Guests to Libvirt Guests

This method is suitable if you have locally the VMDK image file (e.g., the Virtual XP image from local Service Desk).

First, install needed packages:

# yum install qemu-img libguestfs-tools libguestfs-winsupport virsh

[RWMJ notes: libguestfs-winsupport package is only needed on RHEL 6 hosts]

Then, you'll need to acquire the Windows registry entries described in Microsoft KB article 314082 and adjust them for use with virt-win-reg (that is, replace all CurrentControlSet instances with ControlSet001 and make sure the file is properly encoded - see the virt-win-reg(1) manual page for details). The resulting file is also available here. The steps below expect that the entries are available in the file named ./mergeide.reg.

Also, you'll need to create a domain XML definition file for your new libvirt guest. Please download this file as ./virtual-xp.xml and adjust the following fields as needed:

  • name
  • uuid
  • memory / currentMemory
  • arch
  • mac address

Note: you *must* set the full path of the virtual image inside the XML (look for the source file definition).

Finally, the actual conversation can be done in three steps:

# qemu-img convert virtual-xp.vmdk virtual-xp.img
# virt-win-reg --merge virtual-xp.img mergeide.reg
# virsh --connect qemu:///system define virtual-xp.xml

After this you should see your new XP VM in your virt-manager display.

Converting VMware Guests from ESX Server to Libvirt Guests

This method is suitable if your VMware guests are on an ESX server. Please install virt-v2v and see the manual page virt-v2v(1) for details.


Thanks Marko for this excellent tip!

About these ads

8 Comments

Filed under Uncategorized

8 responses to “Guest post: Converting VMware guests to libvirt/KVM guests

  1. slankes

    I have just used the supplied mergeide.reg to convert a w2k3 (32bit) machine from ESXi to kvm. Worked fine.

  2. Andy Pippin

    virtual-xp.xml is returning a 404.

  3. Eric

    I have been trying this but the virt-win-reg command just seems to hang for days. –debug only shows the kvm-qemu command then it pauses as if the vm is just hanging. top shows qemu taking 100% cpu time during this extended delay. It never seems to exit or progress or error. libfs-test-tool seems to hang in the same spot.

    • rich

      This is not the place to get support. Please open a bug including all the details about your environment, the version of libguestfs, and the complete output of libguestfs-test-tool.

  4. Pingback: Converting a Windows 2008R2 vmdk to a KVM Image | A CloudBuilder's Notes

  5. I realize this post is 3.5 years old, so it should not come as a shock that the link to the mergeide.reg file contained within the 4th paragraph is a dead link. This does not exist: http://www.annexia.org/tmp/mergeide.reg

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s