Vagrant is a tool for building and distributing development environments.

Overview

Vagrant

Vagrant is a tool for building and distributing development environments.

Development environments managed by Vagrant can run on local virtualized platforms such as VirtualBox or VMware, in the cloud via AWS or OpenStack, or in containers such as with Docker or raw LXC.

Vagrant provides the framework and configuration format to create and manage complete portable development environments. These development environments can live on your computer or in the cloud, and are portable between Windows, Mac OS X, and Linux.

Quick Start

Package dependencies: Vagrant requires bsdtar and curl to be available on your system PATH to run successfully.

For the quick-start, we'll bring up a development machine on VirtualBox because it is free and works on all major platforms. Vagrant can, however, work with almost any system such as OpenStack, VMware, Docker, etc.

First, make sure your development machine has VirtualBox installed. After this, download and install the appropriate Vagrant package for your OS.

To build your first virtual environment:

vagrant init hashicorp/bionic64
vagrant up

Note: The above vagrant up command will also trigger Vagrant to download the bionic64 box via the specified URL. Vagrant only does this if it detects that the box doesn't already exist on your system.

Getting Started Guide

To learn how to build a fully functional development environment, follow the getting started guide.

Installing from Source

If you want the bleeding edge version of Vagrant, we try to keep main pretty stable and you're welcome to give it a shot. Please review the installation page here.

Contributing to Vagrant

Please take time to read the HashiCorp Community Guidelines and the Vagrant Contributing Guide.

Then you're good to go!

Comments
  • docs: Migrate link formats

    docs: Migrate link formats

    What

    • Migrates the formats of links in Markdown content as part of the Docs Content Link Rewrites project
    • Adds two new GitHub workflow files:
      • .github/workflows/check-legacy-links-format.yml - This is a workflow that checks if links in markdown content are in the new format. It does this by running the link rewrite script from dev-portal, and then asserting that no "rewriteable" links were found. This workflow will be used on subsequent PRs to maintain the new link format.
      • .github/workflows/test-link-rewrites.yml - This is a workflow that executes e2e tests of this PR's changes against the main branch's deploy preview. The tests only run for branches named docs/amb.migrate-link-formats, so future PRs will not have the tests run against them. This is a temporary workflow.

    Reviewing

    With the two new workflows in place, this PR should only need a spot-check.

    Testing

    • [ ] The latest run of the "Legacy Link Format Checker" workflow for this branch should pass (check here)
    • [ ] The latest run of the "Test Link Rewrites" workflow for this branch should pass (check here) except for the following:
      • The main branch's preview URL expects a link to guest-capabilities to be /vagrant/guest-capabilities rather than /vagrant/docs/plugins/guest-capabilities, because of how dev-portal is handling the link. That bug will be fixed in dev-portal, and it does not have to block this PR.
    website 
    opened by ashleemboyer 1
  • Added config.ssh.retries and config.ssh.retry_interval to allow for SSH retries

    Added config.ssh.retries and config.ssh.retry_interval to allow for SSH retries

    Closes #10776

    When provisioning RHEL VMs, i noticed that the hosts become pingable before the SSH daemon is available. Watching the vagrant logs with --debug i noticed that the SSH connection was not being retried properly. Digging into the code, i also discovered that even with a properly setup retry counter, the retries were happening as fast as possible, not allowing time for the SSH daemon to become available.

    To mitigate these problems, i added config.ssh.retries to allow for multiple SSH connection retry attempts before failing (default=5). I also added config.ssh.retry_interval to insert a sleep time (seconds) between each connection attempt, allowing time for the SSH daemon to come up.

    This is my first PR to Vagrant. I tried to do the right things, but i'm sure i'm missing some stuff. If you all could help guide me through the contribution process, i would very much appreciate it!

    opened by nmaludy 1
  • Vagrant outputs warning with Ruby 3.2

    Vagrant outputs warning with Ruby 3.2

    When Vagrant is running with Ruby 3.2 there is a warning output to the console from the grpc library /Users/sophia/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/grpc-1.50.0/src/ruby/lib/grpc/grpc_c.bundle: warning: undefining the allocator of T_DATA class GRPC::Core::TimeSpec

    Debug output

    Vagrant output

     % vagrant status
    /Users/sophia/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/grpc-1.50.0/src/ruby/lib/grpc/grpc_c.bundle: warning: undefining the allocator of T_DATA class GRPC::Core::TimeSpec
    You appear to be running Vagrant outside of the official installers.
    Note that the installers are what ensure that Vagrant has all required
    dependencies, and Vagrant assumes that these dependencies exist. By
    running outside of the installer environment, Vagrant may not function
    properly. To remove this warning, install Vagrant using one of the
    official packages from vagrantup.com.
    
    Current machine states:
    
    default                   not created (virtualbox)
    
    The environment has not yet been created. Run `vagrant up` to
    create the environment. If a machine is not created, only the
    default provider will be shown. So if a provider is not listed,
    then the machine is not created for that environment.
    

    Ruby version

    % ruby --version
    ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin21]
    

    Ref

    https://github.com/grpc/grpc/pull/28559 https://bugs.ruby-lang.org/issues/18007

    upstream core 
    opened by soapy1 0
  • Vagrant up fails when using VM snapshots with VB 7.0

    Vagrant up fails when using VM snapshots with VB 7.0

    Debug output

    vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Clearing any previously set forwarded ports... There was an error while executing VBoxManage, a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below. Command: ["modifyvm", "de8f03f8-3b2e-4de9-acb7-b55669b5faf7", "--natpf1", "delete", "ssh", "--natpf1", "delete", "ssh"] Stderr: VBoxManage.exe: error: Code E_INVALIDARG (0x80070057) (extended info not available) VBoxManage.exe: error: Context: "RemoveRedirect(Bstr(ValueUnion.psz).raw())" at line 2108 of file VBoxManageModifyVM.cpp

    Expected behavior

    Vagrant up should not stop with errors when clearing forwarded ports.

    Actual behavior

    When vagrant up tries to clear any forwarded ports, it lists the forwarded ports and the same port gets duplicated which causes the issue. read_forwarded_port() output: DEBUG virtualbox_7_0: - [1, “ssh”, 2222, 22, “127.0.0.1”] DEBUG virtualbox_7_0: - [1, “ssh”, 2222, 22, “127.0.0.1”]

    See more troubleshooting details here:
    https://discuss.hashicorp.com/t/vbox-vm-with-vagrant-stopped-working/45826/4

    The issue has to do with the routine read_forwarded_port(). It needs to be revisited to account for VB VM that makes use of Snapshots not to have the same forwarded port reported multiple times. hashicorp/vagrant/blob/8549450cff40a55ec193540a5387a09caee309b4/plugins/providers/virtualbox/driver/version_7_0.rb#L224

    Reproduction information

    Vagrant version

    vagrant 2.3.4

    Host operating system

    Windows 10 Enterprise VirtualBox Version 7.0.0 r153978 (Qt5.15.2)

    Steps to reproduce

    1. Create a VM with vagrant up
    2. Vagrant halt
    3. Take a snapshot of the VM with VB gui (--> that would add a new section in the .vbox config file that duplicates the forwarded port)
    4. vagrant up

    Vagrantfile

    Here is the Vagrantfile but

    require_relative 'devenv'

    if not is_valid_environment() exit end

    settings = load_settings('vagrant.yml')

    box_disk_size_gb = settings['vm']['disksize']

    fw_home = settings['framework']['home'] ansible_template = "#{fw_home}/template" vb_name = File.basename(Dir.getwd)

    Vagrant.configure("2") do |config| config.ssh.insert_key = false config.ssh.forward_agent = true config.ssh.forward_x11 = true

    config.vm.hostname = vb_name config.vm.box = settings['framework']['box_name'] if settings['framework']['box_url'] != "" config.vm.box_url = settings['framework']['box_url'] end config.vm.box_check_update = false

    if Vagrant.has_plugin?("vagrant-vbguest") config.vbguest.auto_update = false
    end config.vm.synced_folder ".", "/vagrant"

    config.vm.synced_folder ansible_template, "/template" (settings['ssh']['dir'] != nil) && (config.vm.synced_folder settings['ssh']['dir'], "/ssh_config")

    settings['vm']['mounts'].each do |mount| config.vm.synced_folder mount[0], mount[1], mount_options: [ "dmode=777" ] end

    settings['vm']['ports'].each do |port| config.vm.network "forwarded_port", guest: port[0], host: port[1] end

    config.disksize.size = "#{box_disk_size_gb}GB"

    config.vm.provider "virtualbox" do |vb| vb.gui = settings['vm']['gui'] vb.name = vb_name vb.memory = settings['vm']['memory'] vb.cpus = settings['vm']['cpus'] vb.customize ["modifyvm", :id, "--usbxhci", "off"] vb.customize ["modifyvm", :id, "--accelerate3d", "on"] vb.customize ["modifyvm", :id, "--vram", "64"] vb.customize ["modifyvm", :id, "--clipboard", "bidirectional"] vb.customize ["modifyvm", :id, "--cpuexecutioncap", settings['vm']['cpuexecutioncap']] end

    config.vm.provision "ansible_local" do |ansible| ansible.compatibility_mode = "2.0" ansible.config_file = "/template/ansible.cfg" ansible.install_mode = 'pip_args_only' ansible.pip_install_cmd = "sudo apt-get install -y python3-pip python-is-python3 haveged && sudo ln -s -f /usr/bin/pip3 /usr/bin/pip" ansible.pip_args = "ansible==2.10.7" ansible.playbook = "playbook.yml" ansible.raw_arguments = ['--diff'] end end

    Workaround (temporary)

    Change definition of read_forwarded_ports() in C:\HashiCorp\Vagrant\embedded\gems\2.3.4\gems\vagrant-2.3.4\plugins\providers\virtualbox\driver\version_7_0.rb

    def read_forwarded_ports(uuid=nil, active_only=false) return super end Note: This workaround might not work with initial release of VB 7.0

    provider/virtualbox networking 
    opened by Kalimero66 0
  • Vagrant init not working on Windows 10 Pro N for Workstations

    Vagrant init not working on Windows 10 Pro N for Workstations

    Debug output

    Traceback (most recent call last):
            2: from C:/HashiCorp/Vagrant/embedded/gems/2.3.4/gems/vagrant-2.3.4/bin/vagrant:111:in `<main>'
            1: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
    C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require': cannot load such file -- vagrant (LoadError)
            32: from C:/HashiCorp/Vagrant/embedded/gems/2.3.4/gems/vagrant-2.3.4/bin/vagrant:111:in `<main>'
            31: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:147:in `require'
            30: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:158:in `rescue in require'
            29: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:158:in `require'
            28: from C:/HashiCorp/Vagrant/embedded/gems/2.3.4/gems/vagrant-2.3.4/lib/vagrant.rb:352:in `<top (required)>'
            27: from C:/HashiCorp/Vagrant/embedded/gems/2.3.4/gems/vagrant-2.3.4/lib/vagrant.rb:352:in `each'
            26: from C:/HashiCorp/Vagrant/embedded/gems/2.3.4/gems/vagrant-2.3.4/lib/vagrant.rb:360:in `block in <top (required)>'
            25: from C:/HashiCorp/Vagrant/embedded/gems/2.3.4/gems/vagrant-2.3.4/lib/vagrant.rb:360:in `each'
            24: from C:/HashiCorp/Vagrant/embedded/gems/2.3.4/gems/vagrant-2.3.4/lib/vagrant.rb:343:in `block in <top (required)>'
            23: from C:/HashiCorp/Vagrant/embedded/gems/2.3.4/gems/vagrant-2.3.4/lib/vagrant.rb:343:in `load'
            22: from C:/HashiCorp/Vagrant/embedded/gems/2.3.4/gems/vagrant-2.3.4/plugins/commands/cloud/plugin.rb:2:in `<top (required)>'
            21: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
            20: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
            19: from C:/HashiCorp/Vagrant/embedded/gems/2.3.4/gems/vagrant_cloud-3.0.5/lib/vagrant_cloud.rb:1:in `<top (required)>'
            18: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
            17: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
            16: from C:/HashiCorp/Vagrant/embedded/gems/2.3.4/gems/excon-0.94.0/lib/excon.rb:38:in `<top (required)>'
            15: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
            14: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
            13: from C:/HashiCorp/Vagrant/embedded/gems/2.3.4/gems/excon-0.94.0/lib/excon/socket.rb:2:in `<top (required)>'
            12: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
            11: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
            10: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/resolv.rb:38:in `<top (required)>'
             9: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/resolv.rb:168:in `<class:Resolv>'
             8: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/resolv.rb:171:in `<class:Hosts>'
             7: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
             6: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
             5: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/win32/resolv.rb:7:in `<top (required)>'
             4: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
             3: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
             2: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/win32/registry.rb:4:in `<top (required)>'
             1: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/win32/registry.rb:72:in `<module:Win32>'
    C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/win32/registry.rb:72:in `find': unknown encoding name - CP720 (ArgumentError)
    

    Expected behavior

    Actual behavior

    Reproduction information

    Vagrant version

    Vagrant 2.3.4

    Host operating system

    Windows 10 pro for workstation

    Guest operating system

    Steps to reproduce

    1. install fresh vagrant
    2. vagrant init in cmd

    Vagrantfile

    # Copy-paste your Vagrantfile here. Remove any sensitive information such as passwords, authentication tokens, or email addresses.
    
    host/windows encoding 
    opened by ooossseif 0
Releases(v2.3.4)
Owner
HashiCorp
Consistent workflows to provision, secure, connect, and run any infrastructure for any application.
HashiCorp
Vagrant-boxes - Setup scripts and docs for my vagrant boxes, primarily aimed at Web/SilverStripe developement

zauberfisch's vagrant boxes zauberfisch/silverstripe-debian64 Debian 10 x86_64 LAMP Box with many extra features, pre-configured for SilverStripe Sour

null 6 Jan 24, 2020
Up and running with small Docker environments

Vessel Up and running with small Docker dev environments. Documentation Full documentation can be found at https://vessel.shippingdocker.com. Install

Shipping Docker 1.1k Dec 17, 2022
Vagrant/Puppet GUI

PuPHPet PuPHPet - A simple GUI to set up virtual machines for PHP development What? PuPHPet is a web application that allows you to easily and quickly

PuPHPet 3.9k Dec 24, 2022
Protobox is vagrant web GUI

Protobox Protobox is a layer on top of vagrant and a web GUI to setup virtual machines for web development. A single YAML document controls everything

protobox 354 Nov 30, 2022
A development tool for all your projects that is fast, easy, powerful and liberating

Lando A Liberating Dev Tool For All Your Projects The local development and DevOps tool trusted by professional developers across the galaxy. Free you

Lando 3.6k Jan 7, 2023
A modern Docker LAMP stack and MEAN stack for local development

The Devilbox Usage | Architecture | Community | Features | Intranet | Screenshots | Contributing | Logos | License Support for valid https out of the

cytopia 4k Jan 8, 2023
🎲Neard is a portable WAMP software stack involving useful binaries, tools and applications for your web development.

About Neard is a portable WAMP software stack involving useful binaries, tools and applications for your web development. It also offers several versi

Neard 335 Dec 22, 2022
ServD - a Docker PHP development environment heavily inspired by Laravel Valet and Laradock

ServD ServD is a Docker PHP development environment heavily inspired by Laravel Valet and Laradock, it supports multiple projects within a working dir

Matt Clinton 2 May 13, 2022
Dockerized PHP development stack: Nginx, MySQL, MongoDB, PHP-FPM, HHVM, Memcached, Redis, Elasticsearch and RabbitMQ

PHP Dockerized Dockerized PHP development stack: Nginx, MySQL, MongoDB, PHP-FPM, HHVM, Memcached, Redis, Elasticsearch and RabbitMQ PHP Dockerized giv

Kasper Isager Dalsgarð 1.1k Dec 30, 2022
Full PHP development environment for Docker.

Full PHP development environment based on Docker. Use Docker First - Learn About It Later! Join Us Awesome People Laradock is an MIT-licensed open sou

laradock 11.7k Jan 7, 2023
Stacker - The environment for local web development, ready for use.

Introduction English 简体中文 Why stacker? Stacker - This is a local environment for web development with everything you need. What is its benefit? You do

Nikolay Stepanov 359 Dec 8, 2022
Blazing fast macOS PHP development environment

Introduction Valet+ is a development environment for macOS. No Vagrant, no Docker, no /etc/hosts file. Go here for the valet+ documentation. Credits T

We Provide 1.5k Jan 2, 2023
Docker Containers for simple Laravel development.

Docker containers of Laravel development. Docker Containers for simple Laravel development. Prerequisites This package only works for Linux users righ

Steve Azzopardi 14 May 19, 2022
DDEV-Local: a local PHP development environment system

ddev ddev is an open source tool that makes it simple to get local PHP development environments up and running in minutes. It's powerful and flexible

DDEV 1.6k Dec 29, 2022
Valet WSL is an advanced development environment for Windows Subsystem for Linux

Introduction Valet WSL is an advanced development environment for Windows Subsystem for Linux. No Vagrant, no hosts file manual management. You can ev

EPTIC Solutions 6 Nov 22, 2022
Quickly deploy a seedbox with self-hosted services and a web portal using Docker and docker-compose.

Seedbox Quickly deploy and configure a seedbox with self-hosted services and a web portal using Docker and a single docker-compose.yml file. Screensho

null 6 Dec 7, 2022
Finally a sane way to register available commands and arguments and match your command line in PHP

clue/commander Finally a sane way to register available commands and arguments and match your command line in PHP. You want to build a command line in

Christian Lück 172 Nov 27, 2022
Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:

Latest Salt Documentation Open an issue (bug report, feature request, etc.) Salt is the world’s fastest, most intelligent and scalable automation engi

SaltStack 13k Jan 8, 2023