Book Image

Creating Development Environments with Vagrant

By : MICHAEL KEITH PEACOCK
Book Image

Creating Development Environments with Vagrant

By: MICHAEL KEITH PEACOCK

Overview of this book

Table of Contents (17 chapters)
Creating Development Environments with Vagrant Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating our first Vagrant project


Now that we have Vagrant installed on our machine, let's take a look at creating Vagrant projects. Any folder can act as a Vagrant project; it only requires a special configuration file, called the Vagrantfile, within it. Vagrant uses this file to set up the virtual machines (guests) and manage their integration with our computer (or host machine).

Vagrant has a command to create a Vagrantfile within the current directory you are in, within your computer's terminal: the vagrant init command. To create a new project, let's create a new folder anywhere in our system – ideally, somewhere easily reachable, then we need to go into this folder, and run the init command:

Vagrant will then create a Vagrantfile within that folder, and show us a confirmation message:

If we take a look at the contents of this Vagrantfile file that was created, we will see a range of configuration options. Most of the options are commented out (as they are prefixed with a # character...