[vbox-dev] Virtual TRIM device?

Klaus Espenlaub klaus.espenlaub at oracle.com
Wed Nov 7 02:30:03 PST 2012

The TRIM support (called "discard") is already present since VirtualBox 
4.2.0, however isn't advertised since it's only implemented for the VDI 
format and probably needs more testing. Make backups...

It is only available through the command line (VBoxManage storageattach 
... --discard on). If you have this feature enabled then deleting big 
files will shrink the VDI image in response to TRIM commands if possible 
(remember, VDI images have a 1MB block size).

And the "TRIM all free space before creating VM snapshots" idea doesn't 
work directly, as the file system state as of a snapshot might be 
inconsistent. So it'd be somewhat dangerous to mess with it... either 
way, there's work going on in this direction, too, making image 
compaction use partitioning/file system knowledge. This feature isn't 
enabled AFAICT.


On 06.11.2012 07:31, Steven Noonan wrote:
> Agree, this would be hugely beneficial as far as host storage efficiency
> goes. It would also be beneficial to be able to TRIM all free space
> before creating VM snapshots, making it as compact as possible.
> On Mon, Nov 5, 2012 at 9:49 PM, Marcus Reid <marcus at blazingdot.com
> <mailto:marcus at blazingdot.com>> wrote:
>     Hi,
>     Just a thought: it might be interesting to have a guest TRIM
>     implementation that tells VirtualBox to make that part of the
>     virtual hard drive sparse again. Lots of OS's support AHCI and TRIM
>     now.  Apologies if that functionality already exists or is in the works.
>     Marcus
>     _______________________________________________
>     vbox-dev mailing list
>     vbox-dev at virtualbox.org <mailto:vbox-dev at virtualbox.org>
>     https://www.virtualbox.org/mailman/listinfo/vbox-dev
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> https://www.virtualbox.org/mailman/listinfo/vbox-dev

More information about the vbox-dev mailing list