Skip to content

Instantly share code, notes, and snippets.

@soardex
Created January 3, 2016 11:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soardex/062885a9aaa650dfc8d4 to your computer and use it in GitHub Desktop.
Save soardex/062885a9aaa650dfc8d4 to your computer and use it in GitHub Desktop.
Repackage a CentOS 7 vagrant box
# update the box
sudo yum update -y
sudo yum clean all
# fill the empty spaces with zeroes
sudo dd if=/dev/zero of=/boot/EMPTY bs=1M
sudo rm -f /boot/EMPTY
sudo dd if=/dev/zero of=/EMPTY bs=1M
sudo rm -f /EMPTY
cat /dev/null > ~/.bash_history && history -c && exit
vagrant halt
vagrant package --output mynew.box
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment