Skip to content

Instantly share code, notes, and snippets.

@vinkmar
Last active June 21, 2019 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinkmar/057be5e6173eede9a9ca60807bbd95c6 to your computer and use it in GitHub Desktop.
Save vinkmar/057be5e6173eede9a9ca60807bbd95c6 to your computer and use it in GitHub Desktop.

In fully booted guest OS:

sudo apt-get install zerofree

Reboot guest OS, hold [Esc] on boot, and from Grub menu select Advanced, then Recovery Mode, then Root Console, and run:

zerofree /dev/sda
halt

Then in host OS, run:

vboxmanage modifymedium disk $VDI_FILENAME --compact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment