Skip to content

Instantly share code, notes, and snippets.

@loic-moriame
Created March 12, 2015 15:33
Show Gist options
  • Save loic-moriame/e6db6e419b9705238b06 to your computer and use it in GitHub Desktop.
Save loic-moriame/e6db6e419b9705238b06 to your computer and use it in GitHub Desktop.
Export a CentOS Vagrant Box using VirtualBox
# from the VM to export
# Remove the udev persistent net rules file:
rm -f /etc/udev/rules.d/70-persistent-net.rules
# Clean history
rm .bash_history
history -c
# Shutdown the virtual machine:
shutdown -h now
# from the host
# Create Vagrant box
# vagrant package --output <BOX NAME> --base <VIRTUALBOX VM NAME>
# i.e:
vagrant package --output centos-6.5-x86_64.box --base centos-6.5-x86_64
# Add Vagrant box
# vagrant box add <BOX NAME> <BASE BOX>
# i.e:
vagrant box add centos-6.5-x86_64 centos-6.5-x86_64.box
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment