I've seen instructions for shrinking the .vdi image for a Windows guest machine in VirtualBox 4.1.8. However, it used a tool to write zeroes to free space in the .vdi (nullfile-1.02.exe) that is for Windows only.
The page did say you should find a zerospace.c to do so in a Linux guest, but I can't find such a file any where on the Internet.
Does anyone here have experience shrinking VirtualBox Linux guests?