Just to test whether it was reading or writing that was the error, I tried this:
$ qemu-img info /tmp/convtest.vpc
image: /tmp/convtest.vpc
file format: vpc
virtual size: 2.0G (2147991552 bytes)
disk size: 645M
The size there is incorrect, and identical to what the size of the target is after converting back to raw.
Just to test whether it was reading or writing that was the error, I tried this:
$ qemu-img info /tmp/convtest.vpc
image: /tmp/convtest.vpc
file format: vpc
virtual size: 2.0G (2147991552 bytes)
disk size: 645M
The size there is incorrect, and identical to what the size of the target is after converting back to raw.
Then, testing vboxmanage: vpc.vboxmanage vpc.vboxmanage | grep "irtual size:" vpc.vboxmanage /tmp/convtest. raw.from- vbox-vpc raw.from- vbox-vpc raw.from- vbox-vpc raw.from- vbox-vpc c4f56aea0b9ea84 5a36 /tmp/convtest. raw.from- vbox-vpc
$ vboxmanage convertfromraw /tmp/convtest.raw /tmp/convtest.
$ qemu-img info /tmp/convtest.
virtual size: 2.0G (2147483648 bytes)
$ qemu-img convert -O raw /tmp/convtest.
$ ls -l /tmp/convtest.
-rw-r--r-- 1 smoser smoser 2147483648 2011-10-26 14:58 /tmp/convtest.
$ md5sum /tmp/convtest.
c1f6e09e96361
So, it seems there is a bug writing the vpc format, while reading the format as written by vboxmanage works fine.