Copyright
Table of Contents
Foreword
Preface
Conventions Used in This Book
Using Code Examples
Safari® Books Online
How to Contact Us
Acknowledgements
Chapter 1. An Introduction to Vagrant
Why Vagrant?
The Tao of Vagrant
Alternatives to Vagrant
Plain Desktop Virtualization
Containers
Cloud
Setting Up Vagrant
Installing VirtualBox
Installing Vagrant
Common Mistakes
Using Vagrant Without VirtualBox
Help!
Chapter 2. Your First Vagrant Machine
Up and Running
The Vagrantfile
V1 versus V2 Configuration
Boxes
Up
Working with the Vagrant Machine
State of the Vagrant Machine
SSH
Shared Filesystem
Basic Networking
Teardown
What’s Next?
Chapter 3. Provisioning Your Vagrant VM
Why Automated Provisioning?
Supported Provisioners
Manually Setting Up Apache
Automated Provisioner Basics
Shell Scripts
Chef
Puppet
Multiple Provisioners
“No Provision” Mode
In-Depth Provisioner Usage
Shell Scripts
Chef Server
Puppet
What’s Next?
Chapter 4. Networking in Vagrant
Forwarded Ports
Pros and Cons
Basic Usage
Collision Detection and Correction
TCP versus UDP
Host-Only Networking
Pros and Cons
Basic Usage
Guest Operating System Dependency
Bridged Networking
Pros and Cons
Basic Usage
Composing Networking Options
NAT Requirement As the First Network Interface
What’s Next?
Chapter 5. Modeling Multimachine Clusters
Running Multiple Virtual Machines
Controlling Multiple Machines
Communication Between Machines
Host-Only Networks
Bridged Networks
Real Example: MySQL
What’s Next?
Chapter 6. Boxes
Why Boxes?
Box Format
Basic Box Management with Vagrant
Creating New Boxes from an Existing Environment
Creating New Boxes from Scratch
Creating the VirtualBox Machine
Configuring the Operating System
Installing VirtualBox Guest Additions
Additional Software
Minimizing the Final Box Size
Packaging It Up
Setting Vagrantfile Defaults
What’s Next?
Chapter 7. Extending Vagrant with Plug-Ins
Extensible Features
Managing Vagrant Plug-Ins
Plug-In Development Basics
Plug-In Definition
Plug-In Components
Error Handling
Vagrant Internals
A Basic Plug-In Development Environment
Developing a Custom Command
Component
Implementation
Working with the Virtual Machine
Working with Multimachine Environments
Parsing Command-Line Options
Adding New Configuration Options
Component
Implementation
Accessing the Configuration
Configuration Merging
Validation
Adding a Custom Provisioner
Component
Implementation
Provisioner Configuration
Configuring the Machine
Modifying Existing Vagrant Behavior
Component
Implementation
Useful Keys in the Action Environment
Learning More
Other Plug-In Components
Packaging the Plug-In
Appendix A. Vagrant Environmental Variables
VAGRANT_CWD
VAGRANT_HOME
VAGRANT_LOG
VAGRANT_NO_PLUGINS
VAGRANT_VAGRANTFILE
Appendix B. Vagrant Configuration Reference
Appendix C. Troubleshooting and Debugging
IRC
Mailing List/Google Group
Professional Support
Index
About the Author