What's the purpose? VMDKs in exported VirtualBox OVAs are compressed, yes, but better compression is possible by using tar with maximum gzip compression. However, a .tar.gz file that contains an .ova is harder to use and takes longer to import (requires untar + import). Therefore I would like to have an .ova file that contains a gzip compressed disk image .vmdk. This would have the advantage that double clicking an .ova file is still associated with VirtualBox. But if it's a .tar.gz that contains an .ova, that won't work.
If this is impossible using VirtualBox GUI as well as vboxmanage command line, how could one accomplish the .ova using gzip compression for its .vmdk images?
What I am not looking for is vboxmanage modifymedium --compact / zerofree because that is already discussed elsewhere, it's great, and I am already using that. Additional gzip compression on top of it would be even better.
Gzip compression of VMDK files seems to be supported in both the OVA standard as well as in VirtualBox source code.
Quote OVA standard:
Each file referenced by a File element may be compressed using gzip (see RFC1952). When a File
element is compressed using gzip, the ovf:compression attribute shall be set to “gzip”.
VMware has a bug OVF Package with compressed disks is currently not supported for OVF import (53260). It may seem besides the point but this further indicates that this is possible in theory.
VirtualBox source file tarvfs.cpp mentions gzip several times. So does ApplianceImplImport.cpp and ApplianceImplExport.cpp. Also VirtualBox IAppliance Interface Reference mentions gzip.
VirtualBox source code folder contains a file src/VBox/ValidationKit/tests/api/tdAppliance1-t5.ova which is I guess used as a unit test and that file describes gzip compression.
- Code: Select all Expand viewCollapse view
<File ovf:compression="gzip" ovf:href="tdAppliance1-t5-disk1.vmdk.gz" ovf:id="file1" ovf:size="509"/>
That further indicates that VirtualBox supports this. The only thing that I couldn't find out after hours of internet and source code research is how to create an OVA that uses gzip compression for the disk images it includes. One could:
1. export to .ovf instead,
2. manually or with a script compress the .vmdk with gzip,
3. then edit the .ovf
4. create a tar archive, the actual .ova
That might work? But seems rather cumbersome. Is there an existing tool which can help here?