vagrant box add vs. vagrant init?
vagrant box add
would just add the box and don't create a Vagrantfile
. That's it.
I'm always using vagrant init boxname boxurl
, but there might be use cases where you don't want to place a Vagrantfile. Let's say you want to add a couple of images in a loop for example.
vagrant box add hashicorp/precise32
just download the box image into your vagrant application while:
vagrant init hashicorp/precise32
make a vagrant file in current directory. if vagrant box image hasn`t been downloaded before. then it try to download the vagrant box image.
in the scenario which vagrant box has been added then we want to init a vagrant file. in shell we can get an name auto complete with Tab button, because it knows the vagrant image already.