I tried to convert a VMDK image found in a OVA file to the QCOW2 format with the qemu-img command but it failed with the error message qemu-img: error while reading sector 131072: Invalid argument
user@ubuntu:/tmp$ wget ftp://ftp.sanger.ac.uk/pub/databases/Pfam/vm/PfamWeb_20120124.ova
user@ubuntu:/tmp$ tar xfv PfamWeb_20120124.ova
PfamWeb_20120124_2.ovf
PfamWeb_20120124_2.mf
PfamWeb_20120124_2-disk1.vmdk
user@ubuntu:/tmp$ qemu-img convert -O qcow2 PfamWeb_20120124_2-disk1.vmdk PfamWeb_20120124_2.qcow2
qemu-img: error while reading sector 131072: Invalid argument
user@ubuntu:/tmp$ qemu-img --version | grep "qemu-img version"
qemu-img version 1.0, Copyright (c) 2004-2008 Fabrice Bellard
user@ubuntu:/tmp$ dpkg-query -f='${Version}\n' --show qemu-utils
1.0+noroms-0ubuntu14.1
user@ubuntu:/tmp$ cat /etc/issue
Ubuntu 12.04.1 LTS \n \l
How do I avoid the error?
A bug related to this was fixed in qemu version 1.2.0. Ubuntu 12.04 has an older qemu version, but if you install qemu-img from source code
the conversion runs without errors
Even after compiling qemu from source (from the distributed package or from git), I still had this issue (albeit with a slightly different error; it complained
'image' uses a vmdk feature which is not supported by this qemu version: VMDK version 3
). This was not an OVA created in 1871 by candlelight; it's actually GitHub Enterprise. So why this is not supported in any version of QEMU I could find is still confusing, and I'd welcome some additional insight if anyone has it.At any rate, the solution I found was to grab Citrix XenConvert from http://www.citrix.com/downloads/xenserver/tools/conversion.html . Bafflingly, newer versions have dropped support for simple format conversions, but 2.3.1 allowed me to change the VMDK (extracted from the OVA via a simple "tar -xf") to a VHD, whereupon qemu-img could take it from there. It's possible that the VMWare Converter could also have handled the task; it's at http://www.vmware.com/go/getconverter .