Declarative configuration
DevOps & Tooling / Knowledge library
Vagrant
declared virtual machine environments and provisioning
Why learn Vagrant?
Useful for reproducible VM-based development. Provider support, host resources, and shared-folder behavior can vary between machines.
Where it came from
Vagrant manages development environments through a common workflow and provider integrations. A Vagrantfile describes machine and provisioning settings.
Build your understanding
Work through these exercises in order. Try the task before opening a reference.
- Read a Vagrantfile and identify its provider assumptions.
- Start a disposable development VM.
- Provision a required package.
- Verify port and shared-folder behavior.
- Recreate the environment without relying on manual guest changes.
Documentation and sources
- Official project documentation (developer.hashicorp.com)
Catalog research notes
- Research snapshot: September 9, 2026. This entry summarizes the linked primary documentation; it does not assert a latest release version.
Connect the ideas
Explore next
Real World Example
Standardizing Distributed Web Development Environments
A distributed web development agency with developers working on diverse operating systems including macOS, Windows, and Linux.
The business problem
The team frequently encounters environment drift where local dependencies, database versions, and system configurations differ between developers, leading to inconsistent application behavior and the persistent 'it works on my machine' bug.
How this topic solves it
Vagrant provides a declarative approach to environment management by using a single configuration file, the Vagrantfile, to define the virtual machine's OS, network, and software dependencies. This ensures that every team member initializes an identical environment regardless of their host operating system.
- Define the base virtual machine image and network settings within a Vagrantfile.
- Specify provisioning scripts or configuration management tools like shell scripts to install required software packages.
- Distribute the version-controlled Vagrantfile to all team members.
- Execute vagrant up to trigger the automated creation and configuration of the isolated development environment.
This diagram illustrates the flow from configuration to a functional development environment.
Orchestration layer
Hypervisor (e.g., VirtualBox)
Shell/Chef/Puppet scripts
Isolated VM
- Vagrantfile → reads configuration → Vagrant Engine
- Vagrant Engine → requests VM creation → Virtualization Provider
- Vagrant Engine → triggers software installation → Provisioner
- Virtualization Provider → hosts → Dev Environment
- Provisioner → configures → Dev Environment
Expected business outcome
The team achieves high development and production parity, significantly reducing time spent troubleshooting environment-specific configuration errors and enabling seamless onboarding for new developers.
Limitations and checks
Vagrant relies on local virtualization providers, which can consume significant host system resources such as RAM and CPU. To check for resource exhaustion, developers should monitor host system performance metrics during the provisioning phase.