Converting OVA for use with KVM / QCOW2

Source:

Headline

The OVA file is nothing more than a TAR archive, containing the .OVF and .VMDK files. Easy!

Using Evergreen ILS for example:

~ $ file EvergreentrunkSqueeze.ova EvergreentrunkSqueeze.ova: POSIX tar archive (GNU)

I'ts possible to use the tar command to list the contents

~ $ tar -tf EvergreentrunkSqueeze.ova EvergreentrunkSqueeze.ovf EvergreentrunkSqueeze-disk1.vmdk

Simply extract those things…

~ $ tar -xvf EvergreentrunkSqueeze.ova EvergreentrunkSqueeze.ovf EvergreentrunkSqueeze-disk1.vmdk

Now take a look at the created files The OVF XML file describes the image, it makes for some interesting reading about the expectations of the running environment.

~ $ file EvergreentrunkSqueeze* EvergreentrunkSqueeze-disk1.vmdk: VMware4 disk image EvergreentrunkSqueeze.ova: POSIX tar archive (GNU) EvergreentrunkSqueeze.ovf: XML document text

Recent versions of qemu are able to run directly from the VMDK file, buy why do that? Use QCOW2, it's better. Execute: qemu-img -h and the last line of output shows the supported formats.

~ $ qemu-img -h |tail -n1 Supported formats: raw cow qcow vdi vmdk cloop dmg bochs vpc vvfat qcow2 parallels nbd blkdebug sheepdog hostcdrom hostfloppy host_device file

Now actually convert it, this may take some time.

~ $ qemu-img convert -O qcow2 EvergreentrunkSqueeze-disk1.vmdk EvergreentrunkSqueeze.qcow2

Contents of OVF Files

The OVA is intended to run an Appliance and this OVF file describes the appliance. Examine the contents of this file to determine information about the expected CPU, Memory and other appliance details. These will be important to getting the image to run under KVM. Noteably, Windows has a terrible time moving, ensure you have the MergeIDE fix in place. See Also

OVF, OVA, WTF!?