I setup an Ubuntu 13.04 box from www.vagrantbox.es. Post that I made changes to the box - installed ruby, rails, git, mysql, ngnix, etc. How do I share the modified box with someone else?
As mentioned in the docs, boxes are stored at: Mac OS X and Linux: ~/. vagrant. d/boxes.
Command: vagrant box update This command updates the box for the current Vagrant environment if there are updates available. The command can also update a specific box (outside of an active Vagrant environment), by specifying the --box flag. Note that updating the box will not update an already-running Vagrant machine.
After making your changes, use vagrant package
in the directory with the Vagrantfile. It will shut the machine down and start saving it to a file.
You'll end up with a boxfile in that directory that you can share.
As already answered, vagrant package
creates a new base box out of an existing VM.
Anyway "the Vagrant way" is to use and share a Vagrantfile with provisioners. This way the installation of the software is repeatable. The downside is that initial vagrant up
takes longer while it installs all the software, but on the other hand the shared base box is smaller. Depends on your use case what is the best.
If you choose to share a pre-installed image you can still benefit from automated provisioning using e.g. Packer to build the box.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With