“qemu-img: error while writing”

January 4th, 2008 by peasleer

When converting a raw image (such as an image created using dd) to a VMWare vmdk image in Windows using Qemu’s qemu-img utility, I came across an error. The command I used is as follows:

qemu-img convert -f raw L:\\VMtmp\\winImage.img -O vmdk D:\\vmtmp\\xp.vmdk

Which works fine until the output image reached 2GB in size, at which point it exits with this error:

qemu-img: error while writing

Yay for descriptive error messages! I hunted through the qemu-devel mailing lists, as this is an apparently undocumented feature. The cause behind the error is that the Qemu binaries were compiled for Windows with MinGW, which apparently doesn’t have large file support built in. So the solution to the problem is to either compile your own version of Qemu for Windows using Cygwin (which has had large file support for some time), or do what I do - use linux. The Qemu binaries in linux aren’t affected by this problem, and you can create files of whatever size you desire.


2 Responses to ““qemu-img: error while writing””

Feed for this Entry Trackback Address
  1. 1 Nate

    I’m hitting the same problem on Vista but when the output file hits 10.2 gigs. I don’t get it.

  1. 1

    DIY VMWare Converter | BlobbyBlog 2

    [...] that can successfully convert all 60GB of the RAW image. Even the latest release (0.9.1) failed. I am not alone. Kudos to the authors for fixing this long-standing and painful regression (by either changing the [...]

Leave a Reply