Hey everybody,
Pleae tell me how to extract a VM from VMware in OVA format for KVM migration.
Any help highly appreciated.
Jennifer ![]()
Hey everybody,
Pleae tell me how to extract a VM from VMware in OVA format for KVM migration.
Any help highly appreciated.
Jennifer ![]()
Hi,
The virt-v2v utility transforms virtual machines from other hypervisors like their disk images and configuration metadata for their use with CentOS KVM managed by libvirt.
This guide walks through converting a VM from a VMware vCenter hypervisor (exported as an OVA file) to run on CentOS 7 KVM, CentOS 8 KVM, CentOS 9 KVM, or CentOS 10 KVM.
For a broader look at virt-v2v features, supported migration types, and guides for other VM conversions, check out the documentation on Converting Virtual Machines from Other Hypervisors to KVM with virt-v2v in CentOS 7, 8, 9, and 10.
Once conversion finishes successfully, virt-v2v generates a fresh libvirt domain XML file for the VM, named identically to the source. You can then launch it using libvirt tools like virt-manager or virsh.
virt-v2v requires a 64-bit CentOS Linux host system to run.
Ensure these minimum resources are available:
| Filesystem | Minimum Free Space |
|---|---|
| Root file system | 100 MB |
| /boot | 50 MB |
| All other mountable file system | 10 MB |
The source VM needs at least 100 free inodes. Insufficient free inodesāsuch as on an XFS file system packed with many small files can cause the conversion to slow dramatically or fail entirely.
For Linux VMs, the file system must be one supported by the CentOS kernel (note: btrfs is not supported). For Windows VMs, it must use NTFS; other formats like ReFS are not compatible.
Install the virt-v2v and virtio-win packages, along with all their dependencies, on the host system:
# yum install virt-v2v virtio-win
Export the VMware VM as an .ova fileāeither as a āFolder of filesā (.ovf) or a āSingle fileā (.ova) format works fine. Note that .ova files are essentially uncompressed .tar archives, so you can inspect their contents with commands like tar tf VM.ova.
The exact export steps depend on your VMware product; refer to VMwareās documentation or your vendor for specifics.
Always shut down the VM cleanly before exporting. For Windows guests, confirm itās fully powered offānot hibernating or using fast startupāor the conversion may fail due to this issue.
Transfer the exported .ova file to the conversion host using the scp command.
To convert a VM from an .ova file, run the following commandāreplace guestvm1.ova with your actual .ova filename:
# virt-v2v -i ova guestvm1.ova -of qcow2
OR
# virt-v2v -i ova āFolder of files(OVF)ā -of qcow2
Monitor the conversion process as it runs. Successful output will resemble the example below:
# virt-v2v -i ova guestvm1.ova -of qcow2
[ 0.0] Opening the source -i ova guestvm1.ova
[ 0.0] Creating an overlay to protect the source from being modified
[ 2.0] Opening the overlay
[ 5.0] Initializing the target -o libvirt
[ 4.0] Inspecting the overlay
[ 6.0] Checking for sufficient free disk space in the guest
[ 10.0] Estimating space required on target for each disk
[ 11.0] Converting CentOS 8 to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 14.0] Mapping filesystem data to avoid copying unused and blank areas
[ 15.0] Closing the overlay
[ 15.0] Copying disk 1/1 to /guests/guestvm1-sda (qcow2)
(100.00/100%)
[ 26.0] Creating output metadata
Pool default refreshed
Domain guestvm1 defined from /tmp/v2vlibvirt4fe687.xml
[ 27.0] Finishing off
Confirm that the VM was imported correctly:
# virsh list --all
If this command displays the new Linux VM, the conversion and import succeeded. Next, start the VM, verify everything works fully, then delete the source VM or shift any live services.
Let me know if you want any clarification.
Cheers, Richard.