1

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

Waqas
  • 819

1 Answers1

2

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.

Oli
  • 299,380