In the previous post in this series, I looked at how to provision an Ubuntu box with Vagrant in a matter of moments. Now that the process is understood and the power of Vagrant has been seen, it’s time to break it down a little bit and show how Vagrant is able to create a fully functioning VM with a simple
Vagrant Project Setup
When deploying a new development environment, the first thing to do is set up an area for all of the project files. In the previous post,
vagrant init hashicorp/precise32actually created the project in whatever directory the terminal was open to. For a bit more organization moving forward, I prefer to create a folder for a given Vagrant environment. The configuration files will be stored here, as will any supporting files. For instance, a
www share for an Apache server might exist in this folder. Creating a new project is easy.
mkdir VirtAdmin cd VirtAdmin/ vagrant init
In the desired location, just create a new folder, and from within that folder run
vagrant init.This will automatically generate a Vagrantfile! What’s a Vagrantfile, you might ask?