guumaster
6/2/2013 - 6:07 PM

Reduce VirtualBox VDI image size.

Reduce VirtualBox VDI image size.

1. Install zerofree program:

sudo apt-get install zerofree

2. Reboot Ubuntu.

3. Press <Shift> to enter grub menu.

4. From grub menu select "recovery mode".

5. Select "root" from Recovery Menu.

6. Check to see disk names:

df

7. Mount the disk as read only:

mount -n -o remount,ro -t ext2 /dev/sda1 /

8. Make zeros:

zerofree /dev/sda1

9. Shutdown Ubuntu:

halt

10. From Windows host execute:

"VirtualBox\VBoxManage" modifyhd <disk_name>.vdi compact