Preface

Vagrant is quickly becoming a must-have tool in every software and operation engineer’s toolbox. Used by tens of thousands of companies, the Vagrant workflow is a familiar and highly praised way to build, manage, and distribute automatically created development and test environments. These environments are identical whether you’re working on Mac OS X, Windows, or Linux.

Vagrant takes the cloud, a revolutionary movement founded on the idea of cheap, disposable computing resources, and makes this idea available on anyone’s desktop. With just two commands and zero configuration, Vagrant automatically builds and configures a fully featured virtual machine for any purpose.

And with just a little bit of easy-to-learn configuration, Vagrant can automatically set up complex network configurations, install and manage software within the virtual machine, or package the virtual machine for re-use by other people.

Virtualization is the foundational technology behind what is often referred to as the cloud. Amazon Web Services, Microsoft Azure, virtual private server (VPS) providers, and more are based completely around this technology or those similar to it. These sort of cloud services are now the de facto standard for hosting web applications.

Virtualization is everywhere. The good news is that virtualization technology is readily available to anyone with a modern computer. The bad news is that we’re only at the tip of the iceberg of what is possible with this technology. Vagrant is here to change this.

In early 2010, I worked for a web development consultancy and was frustrated by having to repeatedly set up development environments manually for various projects. I approached John Bender, who was facing similar frustrations at the time, and the project was started.

The first version of Vagrant was released in March 2010. From the beginning, Vagrant was open sourced under the MIT license. In October 2010, Engine Yard announced that they were going to sponsor the Vagrant project. With the support from Engine Yard, I was able to travel around the country to various conferences and speak about Vagrant.

Slowly, more and more people started to use and talk about Vagrant. These early adopters of Vagrant were active in reporting bugs, requesting features, and pointing out any improvements that could be made. Hundreds of early users contributed code and documentation back to the project.

Vagrant 1.0, the first stable version, was released in March 2012, exactly two years after the original version of Vagrant. Despite not releasing an official stable release prior, hundreds of companies were already using Vagrant at that point and had proven 1.0 to be stable.

Today, Vagrant is used by companies worldwide who have found great benefits in integrating Vagrant into their developer or operations workflows. It is difficult to attend any cloud or IT infrastructure conference without hearing Vagrant mentioned or discussed. And yet, Vagrant is still very young. I have full confidence that in just a few more years, Vagrant will become a necessary tool for any developer or operations engineer.

At the time of writing, Vagrant continues to improve and innovate, adding new features and fixing old issues. Despite these changes, Vagrant promises to remain backward-compatible with valid configurations from version 1.0 (the stable release). In an effort to make sure that this book also remains as stable as possible, I will cover the configuration and features of Vagrant 1.0 while running on top of the latest version of Vagrant for maximum stability. This means that some of the latest features may not be covered in this book yet, because they are still evolving and are prone to change. But the proven features—the foundational features that made Vagrant 1.0 and continue to be critical to all aspects of Vagrant usage—are the features that are covered in great detail in this book.

Conventions Used in This Book

The following typographical conventions are used in this book:

Italic
Indicates new terms, URLs, email addresses, filenames, and file extensions.
Constant width
Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.
Constant width bold
Shows commands or other text that should be typed literally by the user.
Constant width italic
Shows text that should be replaced with user-supplied values or by values determined by context.

Tip

This icon signifies a tip, suggestion, or general note.

Warning

This icon indicates a warning or caution.

Using Code Examples

This book is here to help you get your job done. In general, if this book includes code examples, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Vagrant: Up and Running by Mitchell Hashimoto (O’Reilly). Copyright 2013 Mitchell Hashimoto, 978-1-449-33583-0.”

If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at .

Safari® Books Online

Note

Safari Books Online is an on-demand digital library that delivers expert content in both book and video form from the world’s leading authors in technology and business.

Technology professionals, software developers, web designers, and business and creative professionals use Safari Books Online as their primary resource for research, problem solving, learning, and certification training.

Safari Books Online offers a range of product mixes and pricing programs for organizations, government agencies, and individuals. Subscribers have access to thousands of books, training videos, and prepublication manuscripts in one fully searchable database from publishers like O’Reilly Media, Prentice Hall Professional, Addison-Wesley Professional, Microsoft Press, Sams, Que, Peachpit Press, Focal Press, Cisco Press, John Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe Press, FT Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, Course Technology, and dozens more. For more information about Safari Books Online, please visit us online.

How to Contact Us

Please address comments and questions concerning this book to the publisher:

O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international or local)
707-829-0104 (fax)

We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at http://oreil.ly/vagrant_up_running.

To comment or ask technical questions about this book, send email to .

For more information about our books, courses, conferences, and news, see our website at http://www.oreilly.com.

Find us on Facebook: http://facebook.com/oreilly

Follow us on Twitter: http://twitter.com/oreillymedia

Watch us on YouTube: http://www.youtube.com/oreillymedia

Content Updates

October 29, 2013

  • Addressed all submitted errata for the book.
  • Added a section to Chapter 1 called that explains the various versions of Vagrant and which ones are covered in this book. This information was also added to the Preface.

Acknowledgments

Although my name is on the cover, the existence of this book is thanks to many people, both directly and indirectly. Writing this book came at a particularly busy time in my life, full of both professional and personal changes, and I have many people to thank.

I want to first thank the Vagrant community, which continues to motivate and inspire me daily to build the best tools I can. The community is friendly and knowledgeable—and teaches me new things about my own tool almost daily.

Specifically, I want to thank John Bender. John has believed in this project since I first told him the idea over instant messenger, and his passion for the project has only grown since then. Thanks for believing and always pushing me to make Vagrant the best it can be.

I would like to thank a few individuals for reviewing early copies of this book and contributing many helpful suggestions and improvements to my work: Robby Colvin, Matt Stine, and Jeff Sussna. Each of these individuals has been a dedicated Vagrant user for a long time, and their careful eye and experience as Vagrant educators helped shape this book into a truly great learning resource.

Thanks to my editor, Courtney Nash, and the fantastic staff at O’Reilly for their help in the preparation of this book. Courtney’s never-ending presence at every conference I attended was a constant reminder I had a book to write (and more importantly, finish).

Without guidance from my parents, I would never have had the discipline or drive to achieve what I have, including this book. For everything they’ve taught me and showed me along the way, thank you.

Finally, I wrote this book just as I was starting a new company, speaking at dozens of conferences, shipping the biggest Vagrant release ever, and more. For patience while I pushed through these large tasks, continuously showing me the value of maintaining good balance between work and family, and being one of my biggest supporters, I want to thank Amy, whom I love very much. Through good and bad, you’re always there making everything just…better. Thank you so much. It’s time to take a vacation and spend some quality relaxation time in Hawaii!

Get Vagrant: Up and Running now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.