New
#1
Convert VMWare / Vbox VM's to KVM
Hi folks
If you want to convert VMWare VM's or VBOX ones to KVM it's a fairly straight forward but longish process. depending on the size of the original VM's.
The Virtual disk though must be in a single vdmk image so if you have several vdmk files (most people do not allocate the virtual disk as a single file right at the start so it usually grows over time) you need to create a new single vdmk disk.
Don't waste your time by using v2-v type programs or those that combine the multiple vdmk files into a single one -- I've been down that route - usually unsuccessfully after a lot of time and the obvious and best way is to create a new single vdmk image and clone from the original !!!. Why I never thought of that in the first place --no idea !!!.
Then using Macrium or similar clone the original vdmk to the new one.
Now on the KVM system simply run the following command :
qemu-img convert -f vmdk <vmware_image.vmdk> -O qcow2 <kvm_image.qcow2>
Now you can build the Virtual machine using the converted image. Try and keep the hardware as near as possible to what was in the VMware or Vbox one -- looking at the configuration files will help.
Before you start the Virtual disk clone before converting back up the original VM if you want to keep it and then uninstall VMWare tools / Vbox additions. I'd also uninstall the virtual network adapters, any vmware sound adapters and possibly any virtual USB device.
You can add the appropriate adapters back to the KVM setup file for your new VM -- use the Virtual Machine manager GUI if you aren't happy with complex CLI commands for manging VM's -- certainly it's easier when just starting out with this stuff - install virtual machine manager on your HOST KVM system as well as the QEMU/KVM option.
If using EFI systems ensure that the ovmf package is installed on the KVM system .
For those using MBR / BIOS
Here's an XP system -- I had to change the chipset as XP BIOS doen't support some AHCP functionality vut no probs with SATA/SCSI etc.
I've converted all mine (around 9) without any issues apart from just time and running out of Disk space. !!!!
Ensure you use the same UUID's otherwise Windows might get aggressive and want Activation -- "Significant hardware change detected".
I tried to cheat by "imaging a VMware Windows 10 VM" and restoring it on to a blank KVM virtual disk but I couldn't get it to boot - even by using the Macrium fix Windows boot problems. I haven't yet given up on this but one thing might work is to re-create the boot loader on Windows from the Windows WIM image. However I didn't have a WIM for W7.
Have fun. This sort of stuff consumes much more time than you think - but I suppose a lot of us have more time these days for all sorts of reasons. !!!!
I suppose there might also be people bonkers enough to want to do the reverse !!!!! It's possible but as the text books say "We'll leave that as an exercise for our readers" !!!.
Cheers
jimbo
Last edited by jimbo45; 31 Mar 2021 at 03:14. Reason: added details on MBR VM's