Convert VMWare / Vbox VM's to KVM

  1. jimbo45's Avatar
    Posts : 10,491
    Windows / Linux : Arch Linux
       #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 .

    Convert  VMWare / Vbox VM's to KVM-screenshot_20210331_085317.png

    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.

    Convert  VMWare / Vbox VM's to KVM-screenshot_20210331_090902.png

    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; 2 Weeks Ago at 03:14. Reason: added details on MBR VM's
      My Computer

  2. Hopachi's Avatar
    Posts : 1,168
    Linux: Fedora 33 64-bit / Windows 10 Pro 64-bit in VM
       #2

    Very good.
    With qemu-img you can convert in any direction.
    I've used it to move back a VM from KVM to Hyper-V by converting the qcow2 disk to vhdx.
    From VirtualBox vdi disk or VMWare vmdk to any other format is also possible.

    For those who want to give qemu-img a try under Windows, here's a win32 / x64 version for the command line:
    qemu-img for WIndows - Cloudbase Solutions
      My Computers

  3. cereberus's Avatar
    Posts : 12,014
    Windows10
       #3

    No expert in this, but can't you just make an image backup of vm by booting into a Macrium Reflect iso, and then recover it in other vm system recovering to a blank drive. That is what I do to convert vmware to hyperV. Much easier than faffing with conversions.

    Surely principle is same?
      My Computer

  4. jimbo45's Avatar
    Posts : 10,491
    Windows / Linux : Arch Linux
    Thread Starter
       #4

    cereberus said:
    No expert in this, but can't you just make an image backup of vm by booting into a Macrium Reflect iso, and then recover it in other vm system recovering to a blank drive. That is what I do to convert vmware to hyperV. Much easier than faffing with conversions.

    Surely principle is same?
    Hi there

    In theory a good idea but :

    for Windows VMWare->KVM it doesn't work with some Windows releases as the BIOS / UEFI BIOS VM boot and Virtual Chipset emulation seem to be incompatible - not sure why it works on some and not others. Patching / re-compiling QEMU , the VM MBR or UEFI BIOS is needed - not got time or inclination any more to do that kind of stuff. (Or these days even the skillset - if I ever had it in the first place !).

    Convert  VMWare / Vbox VM's to KVM-screenshot_20210403_092822.png

    I've tried that a few times --- it works to convert KVM ->VMWare or even HYPER-V but not the other way around for some Windows VM's. Linux VM's convert without issue too that way.

    Might be that VMWare has a more "comprehensive" virtual hardware set -- wouldn't surprise me as it is a commercial product (and workstation is not particularly cheap) -- whereas KVM is 100% free !!!.

    Cheers
    jimbo
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 12:47.
Find Us




Windows 10 Forums