Skip to content

Instantly share code, notes, and snippets.

@cemeyer
Last active June 27, 2019 23:18
Show Gist options
  • Save cemeyer/11114388 to your computer and use it in GitHub Desktop.
Save cemeyer/11114388 to your computer and use it in GitHub Desktop.
Steps to migrate a VMware VM to KVM
1) Deleted all vmware snapshots for the VM. sync. sync.
2) Followed rwmj's guide to setting up a br0 device for libvirt in Fedora.[0]
3) Grabbed vmware2libvirt[1] from Ubuntu (it's just a standalone python script) and
used it with --bridge br0 -f foo.vmx > foo.xml.
4) Converted my vmdk to raw with qemu-img[2], moved it to /var/lib/libvirtd per
instructions[3]
5) Edited my xml to point to the right disk, use the qemu/raw driver, use the right
path for kvm (/usr/bin/qemu-kvm on Fedora).
5.a) Configure a unix socket serial device (like VMware's "pipe" mode):
...
<devices>
<serial type="unix">
<source mode="bind" path="/path/to/socket_name"/>
<target port="1"/>
</serial>
</devices>
...
6) Import into libvirt with virsh define foo.xml
7) virsh start foo
Optional:
8) virsh autostart foo # Auto-starts the VM on host boot
Accessing console (from remote client with ssh to VM host):
9) virt-viewer -c qemu+ssh://<kvm_host>/system --wait --reconnect <vm_name>
Or with the unix socket and socat:
10) socat UNIX-CONNECT:/path/to/socket_name -,raw,echo=0,b115200,escape=0x1d
[0]: http://wiki.libvirt.org/page/Networking#Bridged_networking_.28aka_.22shared_physical_device.22.29
[1]: https://bazaar.launchpad.net/~ubuntu-virt/virt-goodies/trunk/view/head:/vmware2libvirt
[2]: qemu-img convert -f vmdk -O raw foo.vmdk foo.raw.img
[3]: https://justdavis.com/karl/it/davis/servers/eddings/vms.html (Ubuntu, but partially relevant for Fedora)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment