How To Migrate From Vmware To KVM
The vmware system consists of two disks in raw format: the old boot disk and the second one. It is Windows 2000 Server guest OS.
- Create empty new boot image (use dd).
- Boot stand alone OS from any other disk with old boot disk and new boot image connected (that is at least 3 disks).
- Sign up, make partition and format the new disk (do not make volume).
- xcopy /e /c /r /h /k /o /x /y old_boot_disk:\ new_boot_disk:\
- Copy boot.ini from new boot disk to the second one (that is not boot disk).
- Edit boot.ini on the second disk to boot from rdisk(1)
- Swap disks: new <-> second.
- Boot setup from CD and go on Repair Procedure (after licence agreement) for the new boot disk.
- fdisk new boot image and toggle Boot flag.
- Swap disks back: second <-> new.
- Boot from the new disk.
- Remove vmware tools and devices.
- Reboot and be happy.
P. S. To swap disks and edit boot.ini (items 5,6,7,10) should be excluded if the boot disk is named C:, that is right in most cases. Those items are for strange case, when boot disk is D: and second one is C:.
Starting at v0.12, Qemu-kvm has native support to VMware's disk images v6 (seems to be compatible with v7, used by VMware Server). So VMware images can could be run with Qemu-kvm without any modification (make backups and do it at your own risks though !).
Look at your VMX configuration file:
- scsi0:0.fileName = "zimbra-000001.vmdk"
- uuid.bios = "56 4d 3f 3d 32 80 5b f2-94 31 21 c9 b2 c3 93 b9"
- ethernet0.generatedAddress = "00:0c:29:c3:93:b9"
And then build the command-line:
kvm -drive file=zimbra-000001.vmdk,boot=on \ -net nic,macaddr=00:0c:29:c3:93:b9 -net tap \ -uuid 564d3f3d-3280-5bf2-9431-21c9b2c393b9
The UUID is optional, but might be useful for applications using it for validation (i.e. Windows), and the MAC address as well.
Second way could be to convert the disk image:
kvm-img convert -O qcow2 zimbra-000001.vmdk zimbra.qcow2