This is a Vagrant boxes overview tutorial. In this tutorial you will learn what Vagrant Boxes are, how to use the “vagrant box” command and what happens on the local file system when you use this commands. The “verbs” studied with the “vagrant box” command are: add, list, outdated, update and remove.
Code used during this tutorial:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# Vagrant Boxes overview # Boxes are the package format for Vagrant environments # A box can be used by anyone on any platform that Vagrant supports to bring up an identical working environment # Analogous Linux ISO files # Public Vagrant box catalog https://atlas.hashicorp.com/boxes/search # Download Vagrant box to local # --provider If given, Vagrant will verify that the box you're adding is for the given provider vagrant box add --provider virtualbox ubuntu/precise32 # Ubuntu 12.04.5 LTS (Precise Pangolin) http://releases.ubuntu.com/12.04/ # Explore Vagrant home directory tree -h ~/.vagrant.d/ # Lists all the boxes that are installed into Vagrant vagrant box list # Tells you whether or not the box you're using in your current Vagrant environment is outdated # --global Check for updates for all installed boxes, not just the boxes for the current Vagrant environment vagrant box outdated --global mkdir -p ~/vagrant/ubuntu-precise32 cd ~/vagrant/ubuntu-precise32/ vagrant init ubuntu/precise32 vagrant box outdated # Updates the box for the current Vagrant environment if there are updates available cd ~/ vagrant box update cd ~/vagrant/ubuntu-precise32/ # Updating the box will not update an already-running Vagrant machine # To reflect the changes in the box, you'll have to destroy and bring back up the Vagrant machine vagrant box update tree -h ~/.vagrant.d/ # --all Remove all available versions of a box # --force Forces removing the box even if an active Vagrant environment is using it vagrant box remove --all --force ubuntu/precise32 tree -h ~/.vagrant.d/ # Useful links https://docs.vagrantup.com/v2/boxes.html https://atlas.hashicorp.com/boxes/search http://releases.ubuntu.com/12.04/ https://docs.vagrantup.com/v2/cli/box.html http://stackoverflow.com/questions/10155708/where-does-vagrant-download-its-box-files-to |
Useful links:
https://docs.vagrantup.com/v2/boxes.html
https://atlas.hashicorp.com/boxes/search
http://releases.ubuntu.com/12.04/
https://docs.vagrantup.com/v2/cli/box.html
http://stackoverflow.com/questions/10155708/where-does-vagrant-download-its-box-files-to