Shrink VDI (virtualbox)
Inside of the VM – open a terminal:
dd if=/dev/zero of=/var/tmp/bigemptyfile bs=4096k ; rm /var/tmp/bigemptyfile
Close VM and open a terminal on your host
VBoxManage modifymedium --compact /path/to/thedisk.vdi
Inside of the VM – open a terminal:
dd if=/dev/zero of=/var/tmp/bigemptyfile bs=4096k ; rm /var/tmp/bigemptyfile
Close VM and open a terminal on your host
VBoxManage modifymedium --compact /path/to/thedisk.vdi