Recent from talks
Nothing was collected or created yet.
Vagrant (software)
View on Wikipedia| Vagrant | |
|---|---|
Vagrant starting a virtual machine using vagrant up | |
| Original author | Mitchell Hashimoto[1] |
| Developers | HashiCorp (Mitchell Hashimoto and John Bender) |
| Initial release | March 8, 2010[2] |
| Stable release | 2.4.9[3]
/ 21 August 2025 |
| Repository | |
| Written in | Ruby |
| Operating system | Linux, FreeBSD, macOS, and Microsoft Windows |
| Available in | English |
| Type | Configuration management |
| License | Business Source License 1.1[4] (source-available)(changing to MPL-2.0 after grace period) |
| Website | www |
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]- ^ Marvin, Rob (2015-02-26). "Mitchell Hashimoto is automating the world". Software Development Times. Retrieved 27 June 2016.
- ^ "mitchellh/vagrant: Release v0.1.0". GitHub. Retrieved 6 September 2015.
- ^ "Release 2.4.9". 21 August 2025. Retrieved 15 September 2025.
- ^ "vagrant/LICENSE at main · hashicorp/vagrant". GitHub.
- ^ "Introducing Vagrant | Linux Journal". www.linuxjournal.com. Retrieved 2016-09-14.
- ^ Mitchell Hashimoto (2013). Vagrant: Up and Running (PDF). O'Reilly Media. p. 13. ISBN 978-1449335830.
- ^ "Vagrant: EC2-Like Virtual Machine Building and Provisioning from Ruby". Retrieved May 14, 2012.
- ^ "Vagrant - Getting Started - Project Setup". Retrieved Jan 19, 2016.
- ^ Mitchell Hashimoto (2014-05-06). "Vagrant 1.6". Archived from the original on 2018-07-10. Retrieved 2020-02-23.
- ^ Brett, Adam (2014-09-23). "Vagrant & Ansible Quickstart Tutorial". adamcod.es. Retrieved 2017-08-06.
- ^ "Documentation". Vagrant by HashiCorp. Retrieved 2021-03-27.
- ^ "HashiCorp's new license is still open source-ish, just with less free lunch".
- ^ "HashiCorp adopts Business Source License".
External links
[edit]Vagrant (software)
View on GrokipediaOverview
Introduction
Vagrant is an open-source command-line tool developed by HashiCorp for building, managing, and distributing reproducible development environments using virtualization or containerization technologies.[1][4] 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.[1] 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.[1] As of November 2025, Vagrant continues to be a staple in DevOps workflows, with active maintenance by HashiCorp including recent security updates and community-driven enhancements.[9][10] It integrates seamlessly with modern tools such as Docker for container-based environments, enhancing its utility in cloud-native development pipelines.[11] At its core, Vagrant operates through a declarative configuration file called the Vagrantfile, written in Ruby Domain-Specific Language (DSL), which specifies the environment's parameters including base images (known as "boxes") and provisioning steps.[1] It supports multi-platform hosts, including Windows, macOS, and Linux, and integrates with various providers like VirtualBox for local VM management.[1] This ecosystem enables rapid setup and sharing of environments, fostering collaboration in software engineering projects.[12]Key Features
Vagrant provides a suite of features designed to streamline the creation, management, and sharing of virtualized development environments, emphasizing automation and reproducibility.[1] Central to this is the Vagrantfile, a configuration file that declaratively defines environment settings in code.[13] One core feature is boxes, which are pre-packaged virtual machine images containing an operating system and essential software, enabling rapid environment setup without starting from scratch.[14] These boxes can be downloaded from registries like Vagrant Cloud, a public repository hosted by HashiCorp, and include popular base images such as Ubuntu or CentOS, allowing users to spin up consistent environments quickly across supported platforms.[14] Vagrant supports multi-machine environments, permitting the definition and orchestration of multiple virtual machines within a single Vagrantfile to simulate complex, distributed systems.[15] This capability is particularly useful for clustered applications, where users can specify inter-machine dependencies, networking, and provisioning to manage multi-tier architectures efficiently.[15] Portability is a hallmark of Vagrant, as environments are described entirely in code via the Vagrantfile, making them shareable through version control systems without reliance on specific hardware or host configurations.[1] This ensures that developers, testers, and operations teams can replicate identical setups across different machines, fostering consistency in workflows.[1] Vagrant integrates natively with infrastructure-as-code (IaC) tools for provisioning, automating the installation and configuration of software after the virtual machine is created.[16] Built-in support includes Ansible for playbook-based configuration, Chef for cookbook-driven automation, and Puppet for manifest application, allowing seamless extension of the base environment with custom scripts or remote execution options.[16] The plugin ecosystem enhances Vagrant's flexibility, with extensions developed as Ruby gems that users can install to add custom functionalities.[17] This includes support for additional providers beyond the defaults, such as cloud platforms, or specialized networking options, enabling tailored behaviors without modifying the core tool.[17]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 University of Washington.[18] 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.[18] Inspired by virtualization tools like VirtualBox, Vagrant emphasized automation and reproducibility to enable developers to quickly spin up pre-configured environments, reducing the "it works on my machine" issues prevalent in team-based software development.[18] The project was released under the MIT license, reflecting its open-source ethos from the outset.[18] 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.[18] Early development focused on core functionality for local VM orchestration, particularly benefiting Ruby on Rails 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 Ruby and broader open-source communities for its ability to streamline workflows in inconsistent local setups.[19] By early 2012, adoption had spread to notable organizations including Mozilla, LivingSocial, EventBrite, Yammer, and Disqus, highlighting its growing utility in professional development environments.[18] In response to increasing popularity, Mitchell Hashimoto founded HashiCorp in 2012 alongside Armon Dadgar to support full-time development of Vagrant and related infrastructure tools like Terraform.[20] 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 backward compatibility.[18] 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.[18]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.[21] 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.[22] This addition bridged virtualization and containerization, 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 Rsync for faster file sharing. Later, Vagrant 1.8, released in December 2015, further optimized performance with linked clones for quicker VM provisioning using differential disks in providers like VirtualBox and VMware, alongside new snapshot capabilities for state management and rollback during testing.[23][24] Vagrant 2.0, launched in September 2017, represented a major internal refactor to ensure compatibility with Ruby 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.[7] 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.[25] 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, HashiCorp changed Vagrant's license from MIT to the Business Source License 1.1. Community milestones, including HashiCorp's initial public offering in December 2021, have bolstered Vagrant's ecosystem by funding integrations with other HashiCorp tools like Terraform and Vault, driving adoption in enterprise settings.[26]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 Domain Specific Language (DSL) that allows users to define the configuration of virtual environments in a declarative manner. This file specifies essential virtual machine 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 likeconfig.vm.network and config.vm.synced_folder.[13]
The environment lifecycle represents another critical component, governing the progression of Vagrant-managed machines through distinct states. These states include "not created," where no environment exists; "powered off," indicating a created but inactive machine; 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 project root, which stores metadata like machine IDs and provider details to maintain consistency across sessions.[27]
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 API that supports major version upgrades.[28]
Central to Vagrant's operation is the box format, which packages pre-configured virtual machine images for efficient distribution and deployment. Boxes are structured as tarballs (in formats like tar, tar.gz, or zip) containing provider-specific virtual machine images and configuration files—such as OVF (Open Virtualization Format) or OVA (Open Virtual Appliance) for VirtualBox, .vmdk for VMware, or .vhdx for Hyper-V—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.[29]
Providers and Provisioners
Vagrant providers serve as the backends responsible for executing and managing virtual machines or containers, allowing users to select from various virtualization technologies based on their needs. The default provider is VirtualBox, an open-source virtualization platform that emulates hardware for running guest operating systems on the host machine.[30] Hyper-V, a type-1 hypervisor native to Windows, provides built-in support for local virtual machines without requiring additional software installation on supported Windows versions.[31] For enhanced performance in networking and shared folders, VMware providers—such as those for VMware Workstation, Fusion, or Desktop—are available through paid plugins, offering superior stability for demanding workloads compared to free alternatives.[32] 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.[33] Provisioners, in contrast, handle the automation 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 PowerShell directly on the guest.[34] The Ansible provisioner integrates configuration management by running playbooks from the host or guest, facilitating idempotent deployments across multiple machines.[35] Docker provisioners allow for container orchestration within the virtual machine, streamlining lightweight application testing. These are configured in the Vagrantfile using theconfig.vm.provision directive, with options like enabling provisioning via provision: true.[36]
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.[30] Provisioners communicate with the guest operating system primarily via SSH for Unix-like systems or WinRM for Windows, executing commands securely once the guest is booted and accessible.[36] 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 Ruby to handle container lifecycle events.[37] Such plugins are registered via the Vagrant plugin system, enabling community contributions for specialized use cases like cloud integrations.[38]
Usage
Installation and Setup
Vagrant requires a compatible host operating system, including Windows 10 or later, macOS 10.15 (Catalina) or later, and most Linux distributions running kernel version 3.10 or higher. The software embeds its own Ruby runtime (version 2.5 or later), so no separate Ruby installation is necessary. A minimum of 4 GB RAM on the host is recommended to support virtual machine operations effectively.[39] To install Vagrant, download the appropriate binary package from the official HashiCorp releases page. On Windows, 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 Linux distributions like Ubuntu or Debian, add the HashiCorp 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=$(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 HashiCorp's public key (available at [https](/page/HTTPS)://www.[hashicorp](/page/HashiCorp).com/security).[39][8][40]
After Vagrant installation, configure a virtualization provider, as Vagrant relies on backends like VirtualBox or Hyper-V 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 Hyper-V 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 (Windows 10, 11, or Server 2016 and later) with hardware virtualization support.[31]
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 box 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.[13]
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.[27] To begin, users initialize a new Vagrant environment in an empty project directory using thevagrant 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.[27][13][16]
Several essential CLI commands support ongoing management of Vagrant environments. The vagrant status command displays the current state of machines in the project, 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.[41][42][43]
Vagrant's networking defaults to a private network using Network Address Translation (NAT), which isolates the guest VM while enabling outbound internet access and inbound connections via port forwarding. 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 web server 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 IP address during vagrant up.[44][45]
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.[46][47]
Licensing and Community
License Evolution
Vagrant was originally released under the Mozilla Public License 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.[48] On August 10, 2023, HashiCorp 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.[3] The change aimed to protect HashiCorp'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.[3] Prior versions of Vagrant remain under the Mozilla Public License 2.0 (MPL 2.0), allowing continued use without alteration.[2] 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 GitHub.[49] However, it prohibits offering Vagrant as a managed service that directly competes with HashiCorp's commercial offerings, such as HashiCorp Cloud Platform (HCP), thereby limiting certain SaaS models.[2] This transition sparked community discussions on open-source sustainability but did not affect end-user development workflows.[48] As of 2025, HashiCorp has not reverted to an open-source license for Vagrant, maintaining BSL 1.1 for ongoing development. In February 2025, IBM acquired HashiCorp, but no changes to Vagrant's licensing have been announced as of November 2025.[2][50] Community-driven forks, such as viagrunts under the MIT License, have emerged to preserve permissive open-source access, though they lack official support, updates, or integration with HashiCorp's ecosystem.[51] For commercial needs involving restricted uses, HashiCorp provides enterprise licensing options through paid subscriptions that grant broader permissions.[2] This evolution ties into the 2023 milestone release, where licensing aligned with HashiCorp's strategic focus on hybrid cloud services.[3]Community Contributions and Plugins
Vagrant's plugin system enables extensive customization through community-developed extensions distributed via RubyGems. Plugins are installed using the commandvagrant plugin install <name>.[52] 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,[53] and vagrant-aws, which provides a provider for provisioning and managing infrastructure on Amazon EC2 and VPC.[54]
Community members share pre-configured virtual machine images, known as boxes, on Vagrant Cloud, facilitating rapid setup and reuse across projects; popular boxes, such as those based on Ubuntu, have collectively amassed millions of downloads.[55] Support and discussions occur on dedicated platforms, including the HashiCorp Discuss forum for use cases and best practices,[56] and the project's GitHub issues for bug reports and feature requests.[57]
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.[58] By 2025, contributions have stabilized, with ongoing development of compatibility-focused plugins and regular releases maintaining ecosystem vitality.[59]
Vagrant is utilized by millions of developers to establish consistent, reproducible environments and by over 11,000 companies across industries such as information technology and software development.[60][61] It integrates with CI/CD pipelines, including GitHub Actions, enabling automated provisioning and testing of virtual environments in workflows.[62] HashiCorp's annual conferences, such as HashiConf, feature dedicated Vagrant sessions covering enhancements and developer workflows.[63]