How to reduce size of VirtualBox VDI file

Scenario:

VirtualBox version = 4.0.12
Guest OS = Win 7
Host OS = Linux Mint 9 Isadora (based on Ubuntu)

Perform these tasks on all the Win 7 local hard-disks:

  1. chkdsk /F
  2. defrag /X
  3. sdelete -z

Shutdown the Win 7 VM, then run this command on Mint:
[shell]$ VBoxManage modifyhd /home/user/.VirtualBox/HardDisks/win7.vdi –compact[/shell]

That freed up 5GB of space for me, a 20% reduction.