Creating a local VM using the Vagrant CLI
Now that we have written the configuration file, we can create our VM locally.
To perform this, we will use several Vagrant CLI commands. To display all of the available commands, we will run the vagrant --help
command:
![Figure 5.9 – Displaying the Vagrant commands](https://static.packt-cdn.com/products/9781801818964/graphics/image/B17725_05_009.jpg)
Figure 5.9 – Displaying the Vagrant commands
Note
All details about the Vagrant CLI commands are documented at https://www.vagrantup.com/docs/cli.
In the next section we will learn how to create the VM, then we will connect to this VM, and finally we will perform some scripts.
Creating the VM
To create the VM, navigate to the folder in which we created the Vagrantfile
file, and run the following command:
vagrant up
The output is shown in the following screenshot:
![Figure 5.10 – The Vagrant up execution workflow](https://static.packt-cdn.com/products/9781801818964/graphics/image/B17725_05_010.jpg)
Figure 5.10 – The Vagrant up execution workflow
The execution of the preceding command performs the following steps:
- Import the box from Vagrant Cloud.
- Create...