“qemu-img: error while writing”
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.
I’m hitting the same problem on Vista but when the output file hits 10.2 gigs. I don’t get it.
Jul 12th, 2008 at 9:36 pm