Zerofree Utility


I’m trying to reduce the size of the VDI disk images in VirtualBox and the help recommends Zerofree to zero out all deleted files. Is there any where that I can download this file securely, and does it support ext4?


Hi Matt.

This says it’s OK for ext4: Linux Mint - Community and you can download it there.
This download site list versions for many Linux distros but not for Mint;


Not sure whether I’m doing something wrong, but I click on the pkgs link and then on the appropriate APK link. This takes me to the alpine page. I click on the link beside the repository. Page 4 apparently links to the file, but it takes me back to the alpine site. ??? What am I missing?

You’ve lost me, Matt. I don’t know which pkgs, APK and alpine links you are referring to. But circular references are not uncommon, I find, so you may need to find another source - although I didn’t.

I don’t have Mint so don’t want to screw up my installation by trying it - perhaps you would be best asking on the Mint forum:

Sorry I can’t be of more help.

Your first post stated a download site Clicking on that link takes me to that site, but I cannot get the download as the appropriate links take me in loops without getting to a download. Not to worry. If anyone has a better idea please let me know.


Sorry, I didn’t notice you were referring to the URL. I was just pointing out that that that URL had downloads for lots of Linux distros except Mint - so no surprise you didn’t get anywhere. And still not sure about your refs to APK and Alpine. The Mint download site looked like the only option. No matter.

Sorry. Too much to explain, but I was being thick. I’ve figured it out - I think.

Excellent news - do report later.

Hi Keith,
Excuse me for butting in, isnt Mint still based on Ubuntu or have they sidled away from them? Zerofree is available for Ubuntu and if Mint is still based on Buntu wouldnt it then still be applicable? Just my ramblings.

Hi Wishbone. Many thanks for your input.
Yes; you are right but I deliberately didn’t suggest it as I wasn’t sure it would automatically be appropriate. Just over cautious I guess.
Specifically, there wasn’t an Ubuntu 19 listed to match Matt’s Mint 19, and the versions usually match, I think. Which one would you suggest - 18 or 20?

@Matt: I see now where you got the “Alpine” from. Definitely not recommended!


Good question Keith, I use Peppermint 10 which is based on Mint 19 (I think) and Ubuntu Bionic. What I would do if I was going to download it would be to back up my system first, then try either 18 or 20 and see which one works. Who knows, they might both be suitable. I would strongly remind someone to back up when doing something that might not go to plan. Back up regularly anyway!!!

That`s my twopenneth worth.


Good idea, Tony. How about it, Matt?

Mind you, I’m still not sure of the value of Zerofree.


Hi Keith,

Zerofree sets all the bytes in the unused or deleted files to zeros. This is the only way that VirtualBox can ‘compress’ the VDI virtual HDD. It’s not really for use on a real machine, just on a virtual one.

However, I did try it on the Linux Lite 1 that I have. Daownloaded it through the repository. Everything seemed to work, but the VDI remained the same size. So it probably didn’t work.


Perhaps there was nothing to compress? And I read somewhere that zerofree is for image files rather than installed OSs - or have I misunderstood?


You could be right, but the difference between the VDI file and the usage in the VM was around a gig, which I was expecting to align.

VirtualBox manual suggests (but is not specific) that Zerofree will reduce any unused and/or deleted files (those ones removed from the file catalogue) to zeros, whatever the initial use of the file. VB will then remove these allocation units from the compressed file. This is also a security app for removing the possibility of recovery in a normal system.

For readers as easily confused as I am, the following links may help to understand the various mystical initials used here:
VDI: “Virtual Desktop Infrastructure” - VDI | What is VDI - Javatpoint
VM: “Virtual Machine” -
VB: “VirtualBox” - VM VirtualBox | Virtualization | Oracle United Kingdom

Thanks Keith. I spend some time discussing things with others who talk almost exclusively in abbreviations.

Old joke: “I hate people who use TLAs!” (three letter abbreviations) ;D

I’ll have to get out of the habit, or explain definitively what I’m discussing.