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:

$ VBoxManage modifyhd /home/user/.VirtualBox/HardDisks/win7.vdi --compact

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

One Reply to “How to reduce size of VirtualBox VDI file”

Leave a Reply

Your email address will not be published. Required fields are marked *