-
Notifications
You must be signed in to change notification settings - Fork 1
Repack box from existing one
Open https://atlas.hashicorp.com/boxes/search and choose a box.
I`m using PuPHPet Ubuntu 14.04 x64
-
Open F:\servers\project-name and run
vagrant init puphpet/ubuntu1404-x64
to create Vagrantfile -
Then run
vagrant up --provider virtualbox
to start to compile Virtual Machine -
SSH into vagrant to start customizing new box
vagrant ssh
-
Update and Upgrade server:
sudo apt-get update && sudo apt-get upgrade -y --force-yes
-
Install what you want ...
-
Clean server:
sudo apt-get clean
sudo apt-get autoclean
sudo apt-get autoremove
- Then, “zero out” the drive (only for Ubuntu)
sudo dd if=/dev/zero of=/EMPTY bs=1M
sudo rm -f /EMPTY
- Clear the Bash History and exit the Virtual Machine
cat /dev/null > ~/.bash_history && history -c && exit
- Repackage the Virtual Machine into a New Vagrant Box
vagrant package --output mynew.box
- Add box to your Vagrant
vagrant box add mynewbox mynew.box
This now will “download” the box into your Vagrant install allowing to initiate this from any folder, but before we do this, let’s delete and remove the Vagrant file we built this box from.
vagrant destroy
rm Vagrantfile
rm -rf .vagrant
- PuPHPet
In your puphpet/config.yaml box and box_url use mynewbox then init vagrant
vagrant up