Saturday, June 4, 2011

Compacting a Windows 7 Virtualbox vdi Disk Image

When you add data within a dynamically-sized Guest OS, the vdi file gets larger in the Host OS. When you delete data from within the Guest OS, the vdi file does not get smaller but retains its size. You can compact it to reduce the size and save disk space.

Most of these steps I grabbed from oracle's blog: http://blogs.oracle.com/virtualbox/entry/how_to_compact_your_virtual

  1. Within the Guest OS, delete any files you don't need. Also, run a full system cleanup (I like bleachbit).
  2. Defrag using whatever tool you prefer (I used Smart Defrag)
  3. Download SDelete, and run the following command to zero out free space:
sdelete -c
  1. Shutdown the Guest OS.
  2. From the Host OS, run:
VBoxManage modifyhd Windows7.vdi --compact
And you're done!

No comments:

Post a Comment