Skip to content

Instantly share code, notes, and snippets.

@thearrow
Last active September 28, 2016 04:20
Show Gist options
  • Save thearrow/0b0cc6c990799bb9b0d5 to your computer and use it in GitHub Desktop.
Save thearrow/0b0cc6c990799bb9b0d5 to your computer and use it in GitHub Desktop.
Shrink Vagrant/VBox Disk
# in vbox gui for vagrant machine:
sudo apt-get install zerofree
# boot vm into recovery mode in vbox gui (hold down esc)
df
# (optional) mount -o remount,ro {disk eg. /dev/sda1}
zerofree {disk}
halt
# on host machine after locating box .vmdk:
VBoxManage clonehd {old box}.vmdk {new box}.vmdk --format vmdk
# then switch the vbox vm storage to use the new vmdk file!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment