Reduce the size of a dynamic VDI file in VirtualBox

Posted on

I have got a Virtualbox with debian to build up windows machines using unattended. This virtual HD went up to 54Gb but internaly on 28Gb were used. So when I wanted to move out of that machine it took ages. I wonder if there is a easy way to clean up.
Found it.

start with liveCD,
install zerofree ( apt-get install zerofree)
zerofree /dev/sda1

When finish shutdown the virtual machine and execute on the host system:

VBoxManage modifyhd vdi_file.vdi compact

HOWTO: Reduce the size of a dynamic VDI file in VirtualBox


update:  SytemRescueCD have zerofree installed by default as for version 3.1.0

Thanks god to open source

Posted on

As a new strategic to move people out of windows, i am using virtualbox as  a replacement for old applications that only works on windows. So I use an unattended method to install those vboxes.

A few weeks back I found a problem when enable extra funcions (add-ons) for an smooth use of the machine. and i was 100% that the problem  was on virtualbox software, but I could not know how to present it for the development teams to have a look.

My surprise was today that  someone using same software  reported the problem a month ago and today the fix was  release con the 3.0.8 version.
Love open source!