Convert OVA to QCOW2

28 Sep 2024|2 minute read

I usually use virtual machines for tasks that involve either multiple operating systems in the same type or sandboxing environments, usually for cybersecurity work, such as Capture the Flag.

QEMU, a software used for emulating these virtual environments, has its virtual drives mostly in the QCOW2 file format, but those found available online are mostly available in the ova format.

So, with that in mind, I figured I needed to learn how to convert OVA to QCOW2.

Virtual drive formats

OVA File

An Open Virtualization Appliance (OVA) file is a virtual machine packaged with a disk image and configuration files, specifically designed for effortless deployment across virtualization platforms such as VMware or VirtualBox.

QCOW2 File

The QEMU Copy On Write (QCOW2) file is a type of virtual machine disk that QEMU uses. It only grows as much as needed and has advanced features like compression and snapshots. It’s used in KVM and QEMU virtual environments.

Conversion process

For starters, we should extract the contents of the OVA file, since it’s essentially a compressed archive.

tar -xvf image_vm.ova

Then, we verify two main files: an OVF (configuration file) and a VMDK (disk image). The next step involves converting the VMDK file into a QCOW2 file using the qemu-img tool.

qemu-img convert -p -f vmdk -O qcow2 image_vm.vmdk image_vm.qcow2

Upon completion of this process, we’ll obtain an image that can be imported into a new virtual machine using either QEMU or KVM.

← The one before
Sync KOReader with Dropbox

Up next →
Wi-Fi Hotspot in Linux