Compact VirtualBox disk images

I’m using VirtualBox since a couple of years to run Windows on top of my Linux boxes. After a while, the virtual disk size may increase to unreasonable sizes and I was searching for an option to “compact” it like in Parallels/VMWare.

Contrary to these other virtualization tools, there is nothing in VirtualBox’ GUI to do this. Fortunately, you can use 2 tools to achieve the same goal…

First, you need to download SDelete from Microsoft and run it in the VM:

sdelete -c

Now stop the VM and compact the disk:

VBoxManage modifyhd blah.vdi --compact

That’s it, your disk is now compacted and you have probably gained a couple of GB!

This entry was posted in /dev/null. Bookmark the permalink.

One Response to Compact VirtualBox disk images

  1. josm says:

    Awesome! Thank you for the tip. Will use it.

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>