May 12, 2023

How to compact VirtualBox's VDI file size?

On guest OS or VM

dd if=/dev/zero of=/var/tmp/bigemptyfile bs=4096k ; rm /var/tmp/bigemptyfile
sudo poweroff

On Host OS

VBoxManage modifymedium \
	"/media/sibunglon/Data/VirtualBox VMs/Local Develoment/dependency/dependency.vdi" \
	--compact