Page 1 of 1

convertfromraw --format vmdk bigger than GUI export?

Posted: 11. Nov 2009, 00:43
by matthijs
Hi,

I've been trying to create small vmdk images for distribution. I have a disk with around 2GB of data. When I use VBoxManage convertfromraw --format vmdk, I get a file of around 1.7GB. However, when I add the resulting .vmdk file to Virtualbox, and then export an appliance from there, I get a .vmdk file of just over 600MB. Is there any way to make createfromraw create .vmdk images in the same way as the GUI export appliance feature? Perhaps some of the --variant options (I couldn't find those documented anywhere...).

I've had a look around in the source code, but that didn't help much yet :-)

Any ideas?

Re: convertfromraw --format vmdk bigger than GUI export?

Posted: 11. Nov 2009, 15:27
by matthijs
According to klaus-vb on IRC, the --variant Stream option does exactly this. However, beware that this creates a read-only image, so it should only be used to ship along with an .ovf file or otherwise transferred, it should be imported / converted before using it in a virtual machine.

Some of the --variant options seem to refer to the various extent types in the VMDK specification, though I can't find all of them there.

(Edit: Replaced 'write-only' with 'read-only' and 'stream' with 'Stream')

Re: convertfromraw --format vmdk bigger than GUI export?

Posted: 11. Nov 2009, 21:39
by mpack
Your mention of a "write only image" had me confused for a while, but I take it that "--variant=stream" format is one with deflate compression applied, in which case yes, it would have to be decompressed before you could use it.

Re: convertfromraw --format vmdk bigger than GUI export?

Posted: 11. Nov 2009, 21:49
by matthijs
Sorry, klaus said "write-once" and I translated to that "read-only" (which is effectively the same), but confused them in my reply :-)

Anyway, it seems that convertfromraw with --variant Stream is broken on Virtualbox 3.0 (It works with 3.1 beta). On 3.0 you can still use stream vmdk's, but you'll have to use clonehd (which means you'll need to create a normal vmdk or vdi with convertfromraw first, and then use clonehd (with absolute paths) to convert it to a stream vmdk).