Compressing Virtual Box VDI files

1. Clone your Virtualbox Instance

2. Attach the new VDI file as storage

3. apt-get install zerofree

4. Run the following to get a list of devices


5. Run the following to zero out the device

sudo su
zerofree -v /dev/sda?????

6. Run the following from your Mac commandline

VBoxManage modifyhd --compact VM-disk1.vdi

7. Package your instance

vagrant package --base NAME


Buy Me A Coffee
back arrowBack to Index