I am trying to convert vmdk image to raw format but I am getting an error statement.

qemu-img convert -f vmdk Ubuntu-12.04-LTS-Jeos-1.0-disk1.vmdk -O raw myImage.raw

and I am getting following error.

qemu-img: error while reading sector 327680: Invalid argument

However it creates myImage.raw image with 0 disk size. I have googled it but couldn't find any solution. I am using qemu-img version 1.0 on Ubuntu 12.04 64bit. Any suggestions would be helpful


The syntax needs adjusting. Flag arguments need to come first, then the input file and then the output file.

qemu-img convert -f vmdk -O raw Ubuntu-12.04-LTS-Jeos-1.0-disk1.vmdk myImage.raw

If you're still getting that, it might suggest a corrupted VMDK. I just downloaded the appliance VMDK and ran:

$ qemu-img convert -f vmdk -O raw Ubuntu-12.04-LTS-Jeos-1.0-disk1.vmdk myImage.raw
$ ls -l myImage.raw 
-rw-r--r-- 1 oli oli 2147483648 Jan 16 13:35 myImage.raw

That seems to work fine.

Edit: This seems like it might be a side-effect of an old version of qemu. I'm using Ubuntu 13.10 with version 1.5.0 of qemu-utils. Either upgrade the version of qemu (per the question I linked to) or upgrade Ubuntu.

  • I am getting same error. – Waqas Jan 16 '14 at 13:30
  • Edited. Seems to be a bug in the version of qemu that 12.04 bundles. It works fine in later versions of Ubuntu. – Oli Jan 16 '14 at 13:41
  • I upgraded qemu-img to 1.2.0 and it solved the problem. Thanks for help – Waqas Jan 16 '14 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.