

The trick is, I want to ensure I am in the directory where my Vagrant project is in.

In order to get a Vagrant box up and running, I simply run vagrant up. => box: Adding box 'bento/centos-7.3' (v201708.22.0) for provider: virtualbox 3 - Vagrant Up => box: Loading metadata for box 'bento/centos-7.3' Here I want to download and install a CentOS box for the virtualbox provider: Dans-MacBook-Pro:GitHub dan$ vagrant box add bento/centos-7.3 -provider=virtualbox If I want to add a box, logically I use vagrant box add. For instance, to view the boxes I have installed on my machine I would run vagrant box list: Dans-MacBook-Pro:GitHub dan$ vagrant box list This includes adding, removing, listing and updating. The vagrant box command allows the user to manage the boxes on their local machine. Just like that I have enough to boot up a Vagrant box on my local machine. `` for more information on using Vagrant.įinally let’s look into the Vagrantfile, which as we see just specifies the box I will be using: Dans-MacBook-Pro:MyProj dan$ cat Vagrantfile The comments in the Vagrantfile as well as documentation on Ready to `vagrant up` your first virtual environment! Please read Here, I will use vagrant init and the –m option which means I will not add any helper comments into my Vagrantfile: Dans-MacBook-Pro:MyProj dan$ vagrant init -m hashicorp/precise64Ī `Vagrantfile` has been placed in this directory. To do this I simply run vagrant init with the box address.įirst, I will create a directory: Dans-MacBook-Pro:GitHub dan$ mkdir MyProj In this example, I want to create a very basic Vagrantfile based on a box used from Vagrant Cloud. It will include things like the boxes used, networking, CPU and memory, providers used, shell scripts to run for provisioning among others. A Vagrantfile is basically a configuration file that describes an environment. To understand Vagrant, you first need to understand one of the basic building blocks – Vagrantfile. The Vagrant CLI is very easy to use and provides users a way to manage their Vagrant environment efficiently. Vagrant is a favorite among DevOps professionals as it provides a great way to great re-usable and identical test environments.

In this article, I will point out five commands that every Vagrant user needs to know.
