Convert a vmdk to qcow2
Migrating a vmdk to qcow2
Migrating from ESXi to KVM
If you are migrating from ESXi to KVM there are a couple things you’ll need to have in place.
- Root shell access and scp on the VMware hypervisor.
- The qemu-img package on the conversion host.
- Enough space to hold the vmdk and the qcow2 image that comes out the other side.
- Power off the VM and scoop out the vmdk.
NOTE: You might have to disable the VMware firewall. You’ll know because any attempt to
scpa file out will have the thing spouting off aboutFiPs MoDe InItIaLiZeDand you won’t be able to shuffle files. To fix that run:esxcli network firewall set -e falseand go about your business.
- In a shell on the conversion host run:
qemu-img convert -O qcow2 centos7-flat.vmdk centos7.qcow2 - Import the qcow2 image into your KVM hypervisor.
NOTE: Sometimes you’ll need to boot from a rescue disk to run
dracut -for similar. See this link
Migrating from VMware Workstation or VMware Fusion to KVM
This process is similar to the above but unless you chose to have a single vmdk when you created the VM you’ll have to flatten the disk before converting it.
- Power off the VM and scoop out the vmdk.
- Flatten the vmdk with:
/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager -r win10.vmdk -t 0 win10-flat.vmdk - Convert the image:
qemu-img convert -O qcow2 centos7-flat.vmdk centos7.qcow2
Network
For ubuntu you will need to do this: https://help.ubuntu.com/community/NetworkConfigurationCommandLine/Automatic