Shrink Virtualbox VDI File Size (Windows Guest)

Making a note here so in the future I remember the steps required to shrink a VirtualBox hard-drive file on the host machine:

First need to get SDelete from microsoft and run it on the guest machine to zero out the free space on the drive.

Grab SDelete from

http://www.microsoft.com/technet/sysinternals/Security/SDelete.mspx

Extract it, run it within the guest OS with -c :

sdelete -c c:

and shutdown the guest OS and virtualbox
then on the host (running ubuntu of course):

vditool SHRINK ntfs.vdi

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>