Hubbry Logo
Vagrant (software)Vagrant (software)Main
Open search
Vagrant (software)
Community hub
Vagrant (software)
logo
8 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Vagrant (software)
Vagrant (software)
from Wikipedia
Vagrant
Original authorMitchell Hashimoto[1]
DevelopersHashiCorp (Mitchell Hashimoto and John Bender)
Initial releaseMarch 8, 2010; 15 years ago (2010-03-08)[2]
Stable release
2.4.9[3] / 21 August 2025; 3 months ago (21 August 2025)
Repository
Written inRuby
Operating systemLinux, FreeBSD, macOS, and Microsoft Windows
Available inEnglish
TypeConfiguration management
LicenseBusiness Source License 1.1[4] (source-available)(changing to MPL-2.0 after grace period)
Websitewww.vagrantup.com Edit this on Wikidata

Vagrant is a source-available software product for building and maintaining portable virtual software development environments;[5] e.g., for VirtualBox, KVM, Hyper-V, Docker containers, VMware, Parallels, and AWS. It tries to simplify the software configuration management of virtualization in order to increase development productivity. Vagrant is written in the Ruby language, but its ecosystem supports development in a few other languages.

History

[edit]

Vagrant was first started as a personal side-project by Mitchell Hashimoto in January 2010. The first version of Vagrant was released in March 2010. In October 2010, Engine Yard declared that they were going to sponsor the Vagrant project. The first stable version, Vagrant 1.0, was released in March 2012, exactly two years after the original version was released. In November 2012, Mitchell formed an organization called HashiCorp to support the full-time development of Vagrant; Vagrant remained permissively licensed free software. HashiCorp now works on creating commercial editions and provides professional support and training for Vagrant.[citation needed]

Vagrant was originally tied to VirtualBox, but version 1.1 added support for other virtualization software such as VMware and KVM, and for server environments like Amazon EC2.[6] Vagrant is written in Ruby, but it can be used in projects written in other programming languages such as PHP, Python, Java, C#, and JavaScript.[7][8] Since version 1.6, Vagrant natively supports Docker containers, which in some cases can serve as a substitute for a fully virtualized operating system.[9]

Architecture

[edit]

Vagrant uses "Provisioners" and "Providers" as building blocks to manage the development environments. Provisioners are tools that allow users to customize the configuration of virtual environments. Puppet and Chef are the two most widely used provisioners in the Vagrant ecosystem (Ansible has been available since at least 2014[10]). Providers are the services that Vagrant uses to set up and create virtual environments. Support for VirtualBox, Hyper-V, and Docker virtualization ships with Vagrant, while VMware and AWS are supported via plugins.[citation needed]

Vagrant sits on top of virtualization software as a wrapper and helps the developer interact easily with the providers. It automates the configuration of virtual environments using Chef or Puppet, and the user does not have to directly use any other virtualization software. Machine and software requirements are written in a file called "Vagrantfile" to execute necessary steps in order to create a development-ready box. "Box" is a format and an extension (.box) for Vagrant environments that is copied to another machine in order to replicate the same environment. The official Vagrant documentation[11] details the installation, command line usage, and relevant configuration of Vagrant.[citation needed]

License change

[edit]

HashiCorp announced on Aug 10, 2023 that it changed the license of Vagrant from the MIT license to the Business Source License 1.1.[12][13]

References

[edit]
[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
Vagrant is a source-available tool developed and maintained by for building and managing virtualized development environments in a single, automated workflow. It enables developers to create reproducible, portable setups by defining infrastructure and software configurations in a declarative Ruby-based file called the Vagrantfile, which automates the provisioning of virtual machines across various platforms. Licensed under the Business Source License 1.1 (BSL 1.1) since 2023, Vagrant supports multiple virtualization and cloud providers, including , , , Docker, AWS, and Google Cloud, allowing environments to run consistently on local machines or in the cloud. Originally created by Mitchell Hashimoto in 2010 to address challenges in reproducible development setups, Vagrant was first released in March 2010 and quickly gained popularity for simplifying the isolation of dependencies and configurations in disposable virtual environments. , co-founded by Hashimoto and Armon Dadgar in 2012, built the company around Vagrant as its foundational project, evolving it into a command-line utility written primarily in that integrates seamlessly with configuration management tools such as , , , and Salt. Key features of Vagrant include its focus on automation to reduce "works on my machine" issues, support for sharing pre-built environment images called "boxes" via Vagrant Cloud, and extensibility through plugins for custom providers and functionality. With the stable Vagrant 1.0 release in March 2012, it had expanded beyond initial support to a broader ecosystem, making it a staple in software development, testing, and practices for ensuring consistency across team members and deployment stages. As of 2025, Vagrant continues to be used for rapid environment spin-up, with ongoing updates emphasizing compatibility with modern virtualization technologies and cloud-native workflows.

Overview

Introduction

Vagrant is an open-source command-line tool developed by for building, managing, and distributing reproducible development environments using or technologies. It allows developers to define and automate the creation of isolated, portable virtual machines (VMs) or containers that closely mimic production setups, thereby addressing discrepancies in local environments and promoting consistency across development teams. By encapsulating dependencies and configurations within disposable environments, Vagrant eliminates the common "it works on my machine" issue that arises from varying host systems and software versions. As of November 2025, Vagrant continues to be a staple in workflows, with active maintenance by including recent security updates and community-driven enhancements. It integrates seamlessly with modern tools such as Docker for container-based environments, enhancing its utility in cloud-native development pipelines. At its core, Vagrant operates through a declarative configuration file called the Vagrantfile, written in Domain-Specific Language (DSL), which specifies the environment's parameters including base images (known as "boxes") and provisioning steps. It supports multi-platform hosts, including Windows, macOS, and , and integrates with various providers like for local VM management. This ecosystem enables rapid setup and sharing of environments, fostering collaboration in projects.

Key Features

Vagrant provides a suite of features designed to streamline the creation, management, and sharing of virtualized development environments, emphasizing automation and reproducibility. Central to this is the Vagrantfile, a that declaratively defines environment settings in code. One core feature is boxes, which are pre-packaged images containing an operating system and essential software, enabling rapid environment setup without starting from scratch. These boxes can be downloaded from registries like Vagrant Cloud, a public repository hosted by , and include popular base images such as or , allowing users to spin up consistent environments quickly across supported platforms. Vagrant supports multi-machine environments, permitting the definition and orchestration of multiple virtual machines within a single Vagrantfile to simulate complex, distributed systems. This capability is particularly useful for clustered applications, where users can specify inter-machine dependencies, networking, and provisioning to manage multi-tier architectures efficiently. Portability is a hallmark of Vagrant, as environments are described entirely in code via the Vagrantfile, making them shareable through systems without reliance on specific hardware or host configurations. This ensures that developers, testers, and operations teams can replicate identical setups across different machines, fostering consistency in workflows. Vagrant integrates natively with infrastructure-as-code (IaC) tools for provisioning, automating the installation and configuration of software after the is created. Built-in support includes for playbook-based configuration, for cookbook-driven automation, and for manifest application, allowing seamless extension of the base environment with custom scripts or remote execution options. The plugin ecosystem enhances Vagrant's flexibility, with extensions developed as Ruby gems that users can install to add custom functionalities. This includes support for additional providers beyond the defaults, such as platforms, or specialized networking options, enabling tailored behaviors without modifying the core tool.

History

Origins and Early Development

Vagrant was developed by Mitchell Hashimoto, with contributions from John Bender, as a personal open-source project starting in January 2010 while Hashimoto was a student at the . The tool was initially created to simplify the management of virtual machines for development and testing purposes, addressing common pain points such as the time-consuming manual setup of VM environments and inconsistencies across different operating systems and distributions. Inspired by virtualization tools like , Vagrant emphasized and to enable developers to quickly spin up pre-configured environments, reducing the "it works on my machine" issues prevalent in team-based . The project was released under the , reflecting its open-source ethos from the outset. The first version, Vagrant 0.1.0, was made available on March 7, 2010, marking the beginning of its public availability as a Ruby-based command-line tool. Early development focused on core functionality for local VM orchestration, particularly benefiting developers who needed reliable, isolated setups for web application testing. Over the next two years, iterative releases built community interest, with Vagrant gaining traction in 2011 and 2012 among and broader open-source communities for its ability to streamline workflows in inconsistent local setups. By early 2012, adoption had spread to notable organizations including , , , Yammer, and , highlighting its growing utility in professional development environments. In response to increasing popularity, Mitchell Hashimoto founded in 2012 alongside Armon Dadgar to support full-time development of Vagrant and related infrastructure tools like Terraform. This transition enabled sustained investment in the project. The milestone Vagrant 1.0 was released on March 14, 2012—exactly two years after the initial version—establishing the first stable release with commitments to . This version introduced key concepts such as "boxes," which are shareable, pre-packaged VM images, and basic provisioning capabilities using shell scripts, laying the foundation for reproducible development environments.

Major Releases and Milestones

Vagrant 1.5, released in March 2014, marked a significant advancement by introducing multi-machine support, allowing users to define and manage multiple virtual machines within a single Vagrantfile configuration. This feature streamlined complex environment setups for development teams working on distributed systems. Additionally, it enhanced box management through versioned boxes and integration with Vagrant Cloud, a platform for discovering, sharing, and versioning pre-built development environments, simplifying the process of obtaining and updating base images. In May 2014, Vagrant 1.6 expanded its scope beyond traditional virtual machines by incorporating the Docker provider, enabling users to create and manage container-based development environments directly through Vagrant commands. This addition bridged and , allowing developers to leverage Docker's lightweight nature while maintaining Vagrant's reproducible workflow. The release also introduced features like global status commands for overseeing multiple environments and improved synced folder options, including for faster . Later, Vagrant 1.8, released in December 2015, further optimized performance with linked clones for quicker VM provisioning using differential disks in providers like and , alongside new snapshot capabilities for state management and rollback during testing. Vagrant 2.0, launched in September 2017, represented a major internal refactor to ensure compatibility with 2.x runtimes, dropping support for the outdated Ruby 1.9 and enabling better integration with modern development tools. It enhanced the plugin system for greater extensibility, allowing easier development and distribution of custom providers and provisioners, while improving host support on Windows through refined networking and guest OS handling. These changes solidified Vagrant's role in cross-platform workflows, supporting a wider array of guest operating systems including Windows and macOS. The Vagrant 2.4 series, beginning with version 2.4.0 in October 2023, introduced support for multi-architecture boxes, allowing a single box to support multiple CPU architectures such as amd64 and arm64. As of November 2025, the ongoing 2.4.x releases, including 2.4.9 in August 2025, incorporate bug fixes and compatibility improvements. In August 2023, changed Vagrant's license from MIT to the Business Source License 1.1. Community milestones, including 's in December 2021, have bolstered Vagrant's ecosystem by funding integrations with other tools like Terraform and Vault, driving adoption in enterprise settings.

Architecture

Core Components

Vagrant's core components form the foundational elements that enable its declarative approach to virtual machine management. At the heart of this system is the Vagrantfile, a Ruby-based (DSL) that allows users to define the configuration of virtual environments in a declarative manner. This file specifies essential attributes, such as CPU allocation, memory limits, network interfaces, and shared directories between host and guest systems. For instance, configurations for memory and CPU are typically set within provider-specific blocks, while networking and synced folders use universal settings like config.vm.network and config.vm.synced_folder. The environment lifecycle represents another critical component, governing the progression of Vagrant-managed through distinct states. These states include "not created," where no environment exists; "powered off," indicating a created but inactive ; and "running," denoting an active, operational VM. Transitions between states are orchestrated by core commands, such as vagrant up to initialize and start the environment, and vagrant destroy to terminate and remove it entirely. State information is persisted locally in the .vagrant directory within the , which stores metadata like machine IDs and provider details to maintain consistency across sessions. Vagrant's plugin architecture provides a modular framework for extending its core capabilities without altering the base application. Plugins are loaded dynamically at runtime, allowing seamless integration of new features such as custom provisioners or guest OS support. This extensibility relies on Ruby-based hooks that intercept specific events in the Vagrant workflow, for example, during box downloads or machine provisioning, enabling developers to inject custom logic. The system ensures stability through a well-defined that supports major version upgrades. Central to Vagrant's operation is the box format, which packages pre-configured images for efficient distribution and deployment. Boxes are structured as tarballs (in formats like , tar.gz, or zip) containing provider-specific images and configuration files—such as OVF () or OVA (Open Virtual Appliance) for , .vmdk for , or .vhdx for —alongside essential metadata. The metadata.[json](/page/JSON) file within the box includes details on the provider, version, and compatibility requirements, facilitating automatic checks for suitability before import. This format supports versioning, allowing users to specify and manage updates to base images reliably.

Providers and Provisioners

Vagrant providers serve as the backends responsible for executing and managing virtual machines or containers, allowing users to select from various technologies based on their needs. The default provider is , an open-source platform that emulates hardware for running guest operating systems on the host machine. , a type-1 native to Windows, provides built-in support for local virtual machines without requiring additional software installation on supported Windows versions. For enhanced performance in networking and shared folders, providers—such as those for , Fusion, or Desktop—are available through paid plugins, offering superior stability for demanding workloads compared to free alternatives. Providers for cloud and virtualized environments, including AWS (cloud) and Libvirt (KVM-based), extend Vagrant to remote or local setups via community plugins, enabling the orchestration of instances in public clouds or KVM-based setups. Provisioners, in contrast, handle the of software installation and configuration after the virtual environment is created, ensuring reproducible setups. Common provisioners include the shell provisioner, which executes inline scripts or files in languages like Bash or directly on the guest. The provisioner integrates by running playbooks from the host or guest, facilitating idempotent deployments across multiple machines. Docker provisioners allow for container orchestration within the , streamlining lightweight application testing. These are configured in the Vagrantfile using the config.vm.provision directive, with options like enabling provisioning via provision: true. Providers interact with their underlying technologies through specialized APIs to control virtual machine lifecycle operations, such as creation, suspension, and destruction; for instance, the VirtualBox provider leverages the VirtualBox COM API for these tasks. Provisioners communicate with the guest operating system primarily via SSH for systems or WinRM for Windows, executing commands securely once the guest is booted and accessible. This model ensures provider-agnostic abstractions within Vagrant while delegating hardware-specific emulation to the backend. Vagrant's extensibility allows developers to create custom providers and provisioners as Ruby-based plugins, integrating new backends or automation tools seamlessly into the ecosystem. For example, the Vagrant-Docker plugin extends the core to treat Docker containers as first-class environments, implementing provider methods in to handle container lifecycle events. Such plugins are registered via the Vagrant plugin system, enabling community contributions for specialized use cases like cloud integrations.

Usage

Installation and Setup

Vagrant requires a compatible host operating system, including or later, macOS 10.15 (Catalina) or later, and most distributions running kernel version 3.10 or higher. The software embeds its own runtime (version 2.5 or later), so no separate installation is necessary. A minimum of 4 GB RAM on the host is recommended to support operations effectively. To install Vagrant, download the appropriate binary package from the official releases page. On , execute the .msi installer with administrative privileges. For macOS, use Homebrew by running brew tap [hashicorp](/page/HashiCorp)/tap followed by brew install vagrant, or install the .dmg package directly. On distributions like or , add the APT repository with curl -fsSL [https](/page/HTTPS)://apt.releases.[hashicorp](/page/HashiCorp).com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg and echo "deb [arch=&#36;(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] [https](/page/HTTPS)://apt.releases.[hashicorp](/page/HashiCorp).com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list, then install via sudo apt update && sudo apt install vagrant; similar steps apply for RPM-based systems using yum or dnf. To ensure integrity, verify downloads using the provided SHA256 checksums and GPG signatures signed with 's public key (available at [https](/page/HTTPS)://www.[hashicorp](/page/HashiCorp).com/security). After Vagrant installation, configure a virtualization provider, as Vagrant relies on backends like or to create and manage virtual machines. Download and install VirtualBox 7.x (the latest stable version as of 2025) from the Oracle website, ensuring it matches your host architecture. On Windows hosts, enable by opening the "Turn Windows features on or off" dialog in the Control Panel, checking the Hyper-V box, and restarting the system; this feature requires Windows Pro, Enterprise, Education, or Server editions (, 11, or Server 2016 and later) with support. Once installed, verify Vagrant by executing vagrant version in your terminal or command prompt, which should display the installed version (e.g., 2.4.1 or later). For initial customization, create an optional global Vagrantfile in the ~/.vagrant.d/ directory (or C:\Users\<username>\.vagrant.d\ on Windows) to define project-wide defaults, such as download mirrors via Vagrant.configure("2") do |config|; config.vm.box_download_options["--insecure"] = true; end. This file loads before project-specific configurations and can streamline setups across multiple environments.

Basic Workflow and Commands

The basic workflow for Vagrant involves initializing a project directory, configuring the environment via a Vagrantfile, launching the virtual machine (VM), interacting with it, and eventually tearing it down, all managed through simple command-line interface (CLI) commands. This process enables developers to create reproducible development environments efficiently. To begin, users initialize a new Vagrant environment in an empty project directory using the vagrant init <box> command, which generates a default Vagrantfile—a Ruby-based configuration file that defines the VM's settings, such as the base box (pre-built OS image). For example, vagrant init hashicorp/bionic64 sets up a Vagrantfile using the Ubuntu 18.04 box from HashiCorp's repository. Next, users edit the Vagrantfile to customize aspects like the VM provider or additional configurations. The environment is then started with vagrant up, which downloads the specified box if necessary, boots the VM, and applies any provisioning steps defined in the Vagrantfile. Once running, users can access the VM's shell via vagrant ssh, which connects over SSH using default credentials (typically vagrant user with passwordless access). Provisioning, if configured in the Vagrantfile (e.g., via config.vm.provision), automates guest setup such as installing software during vagrant up. To clean up, vagrant destroy stops the VM and removes all associated resources, confirming the action to prevent accidental data loss. Several essential CLI commands support ongoing management of Vagrant environments. The vagrant status command displays the current state of machines in the , indicating whether they are powered off, running, or not created. For graceful shutdown without destruction, vagrant halt stops the running VM, equivalent to a clean power-off. If changes are made to the Vagrantfile, vagrant reload restarts the VM and reapplies the configuration, useful for iterative development. Box management is handled through subcommands: vagrant box add <box> downloads and installs a new base image (e.g., vagrant box add [hashicorp](/page/HashiCorp)/bionic64), vagrant box update refreshes existing boxes to their latest versions, and vagrant box remove <box> deletes unused boxes to free disk space. These commands operate globally or per-project as needed. Vagrant's networking defaults to a using (NAT), which isolates the guest VM while enabling outbound and inbound connections via . By default, port 2222 on the host forwards to port 22 (SSH) on the guest, but custom mappings can be added to the Vagrantfile, such as config.vm.network "forwarded_port", guest: 80, host: 8080 to expose a running on the guest's port 80 via the host's port 8080. For scenarios requiring direct network access, a public network can be configured with config.vm.network "public_network", which bridges the guest to the host's network or assigns a static IP (e.g., config.vm.network "public_network", ip: "192.168.1.10"), allowing the guest to obtain a routable during vagrant up. Synced folders facilitate seamless file sharing between the host and guest, mounting the project directory by default at /vagrant in the guest for immediate access to code and files. This is configured in the Vagrantfile using config.vm.synced_folder "host_path", "guest_path", such as config.vm.synced_folder ".", "/vagrant" for the root project folder. Vagrant supports multiple protocols depending on the provider; for instance, VirtualBox uses shared folders by default, while NFS (type: "nfs") or SMB (type: "smb") can be specified for better performance on Unix or Windows hosts, respectively, with options like config.vm.synced_folder "src/", "/app", type: "nfs". Changes on either side are automatically synchronized during VM operation.

Licensing and Community

License Evolution

Vagrant was originally released under the 2.0 (MPL 2.0) in 2010, which permitted broad open-source use, including modification, distribution, and commercial applications without significant restrictions. This permissive license facilitated widespread adoption and contributions from the developer community throughout its early years. On August 10, 2023, announced a shift to the Business Source License 1.1 (BSL 1.1) for all future releases of Vagrant and other core products, effective immediately for versions released after that date. The change aimed to protect 's investments by restricting the use of the software in competing cloud-hosted services offered by third-party vendors, following a four-year evaluation period after which such commercial uses would require a separate license. Prior versions of Vagrant remain under the 2.0 (MPL 2.0), allowing continued use without alteration. Under BSL 1.1, Vagrant supports non-commercial use, internal commercial applications, modification, and redistribution, including forking for personal or non-competitive projects, while keeping the source code publicly available on . However, it prohibits offering Vagrant as a managed service that directly competes with 's commercial offerings, such as HashiCorp Cloud Platform (HCP), thereby limiting certain SaaS models. This transition sparked community discussions on open-source sustainability but did not affect end-user development workflows. As of 2025, has not reverted to an open-source license for Vagrant, maintaining BSL 1.1 for ongoing development. In February 2025, acquired , but no changes to Vagrant's licensing have been announced as of November 2025. Community-driven forks, such as viagrunts under the , have emerged to preserve permissive open-source access, though they lack official support, updates, or integration with 's ecosystem. For commercial needs involving restricted uses, provides enterprise licensing options through paid subscriptions that grant broader permissions. This evolution ties into the 2023 milestone release, where licensing aligned with 's strategic focus on hybrid cloud services.

Community Contributions and Plugins

Vagrant's plugin system enables extensive customization through community-developed extensions distributed via . Plugins are installed using the command vagrant plugin install <name>. Dozens of such plugins exist, including vagrant-vbguest, which automatically detects and installs the appropriate version of VirtualBox Guest Additions within guest virtual machines to ensure optimal performance and shared folder functionality, and vagrant-aws, which provides a provider for provisioning and managing infrastructure on Amazon EC2 and VPC. Community members share pre-configured images, known as boxes, on Vagrant Cloud, facilitating rapid setup and reuse across projects; popular boxes, such as those based on , have collectively amassed millions of downloads. Support and discussions occur on dedicated platforms, including the HashiCorp Discuss forum for use cases and best practices, and the project's issues for bug reports and feature requests. The 2023 transition to the Business Source License prompted varied community responses, including increased forking of niche components like host-specific integrations to preserve open-source accessibility. By 2025, contributions have stabilized, with ongoing development of compatibility-focused plugins and regular releases maintaining ecosystem vitality. Vagrant is utilized by millions of developers to establish consistent, reproducible environments and by over 11,000 companies across industries such as and . It integrates with pipelines, including Actions, enabling automated provisioning and testing of virtual environments in workflows. HashiCorp's annual conferences, such as HashiConf, feature dedicated Vagrant sessions covering enhancements and developer workflows.

References

Add your contribution
Related Hubs
User Avatar
No comments yet.