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
The smart virtual machines manager. A modern CLI for Vagrant Boxes.

The smart virtual machines manager Table of Contents: What is Vermin Install Vermin Usage Contributors TODO What is Vermin Vermin is a smart, simple a

Muhammad Hewedy 126 Dec 22, 2022
Reward is a Swiss Army knife CLI utility for orchestrating Docker based development environments.

Reward Reward is a Swiss Army knife CLI utility for orchestrating Docker based development environments. It makes possible to run multiple local envir

null 51 Dec 9, 2022
Ensi-local-ctl - ELC - orchestrator of development environments

ELC - orchestrator of development environments With ELC you can: start a couple

MadridianFox 1 Oct 13, 2022
Tool (in Go!) to compare and diff container and host environments. Dinosaur fun!

Compenv compare environments between containers, and host ??️ This is a simple tool to compare environments. This means the environment on your host v

Vanessasaurus 1 Sep 24, 2022
A tool for managing complex enterprise Kubernetes environments as code.

kubecfg A tool for managing Kubernetes resources as code. kubecfg allows you to express the patterns across your infrastructure and reuse these powerf

null 97 Dec 14, 2022
Open Service Mesh (OSM) is a lightweight, extensible, cloud native service mesh that allows users to uniformly manage, secure, and get out-of-the-box observability features for highly dynamic microservice environments.

Open Service Mesh (OSM) Open Service Mesh (OSM) is a lightweight, extensible, Cloud Native service mesh that allows users to uniformly manage, secure,

Open Service Mesh 2.5k Jan 2, 2023
Example used to try a compose application with Docker Dev Environments

compose-dev-env Example used to try a Compose application with Docker Dev Environments. This example is based on the nginx-golang-mysql sample of awes

Docker Samples 92 Dec 29, 2022
Composer is a simple process manager for dev environments.

Composer Composer is a simple service manager for dev environments. How to build/install it? To build composer under ./bin, run: make build To build

Thought Foundry, Inc. 2 May 12, 2022
A gh-cli extension for managing environments.

gh-environments A gh-cli extension for managing environments. Installation and Upgrades gh extension install chelnak/gh-environments gh extension upgr

Craig Gumbley 9 Nov 2, 2022
Tigris is a modern, scalable backend for building real-time websites and apps.

Tigris Data Getting started These instructions will get you through setting up Tigris Data locally as Docker containers. Prerequisites Make sure that

Tigris Data Inc 403 Dec 27, 2022
Substation is a cloud native toolkit for building modular ingest, transform, and load (ITL) data pipelines

Substation Substation is a cloud native data pipeline toolkit. What is Substation? Substation is a modular ingest, transform, load (ITL) application f

Brex 129 Dec 30, 2022
library to make building things with bitclout easy

cloutcli library to make building things with bitclout easy quick start demo cmd $ ./clout demo clout demo visualizegraph # make clout.gv graph fi

Andrew Arrow 18 Jul 27, 2022
Kratix is a framework for building Platform-as-a-Product

Kratix κρατήστε μια υπόσχεση | kratíste mia ypóschesi | Keep a promise Kratix is a framework for building Platform-as-a-Product. Kratix enables platfo

Syntasso 175 Dec 31, 2022
Go-github-app - Template for building GitHub Apps in Go.

Template for GitHub Apps built with Golang Blog Posts - More Information About This Repo You can find more information about this project/repository a

Martin Heinz 54 Dec 25, 2022
A best practices Go source project with unit-test and integration test, also use skaffold & helm to automate CI & CD at local to optimize development cycle

Dependencies Docker Go 1.17 MySQL 8.0.25 Bootstrap Run chmod +x start.sh if start.sh script does not have privileged to run Run ./start.sh --bootstrap

Quang Nguyen 4 Apr 4, 2022
⚔ Personal Golang starter kit with an engineer research perspective, expressjs developer friendly, and aims for rapid app development.

Goku (WIP; Author Only) ⚔ Personal Golang starter kit with an engineer research perspective, expressjs developer friendly, and aims for rapid app deve

Fauzan 1 Jan 6, 2022
Enterprise-grade application development platform

Erda Overview Feature list Architecture Related repositories erda-proto erda-infra erda-ui Quick start To start using erda To start developing erda Do

Erda 2.5k Dec 28, 2022
Fake AWS S3 server for local development

FakeS3 server for local development Download latest binaries here Creating new release go get github.com/johannesboyne/gofakes3/cmd/[email protected]

Railsware 4 Aug 16, 2022
fiber-air-docker development environment boilerplate, examples

ON AIR! fiber-air-docker development environment boilerplate TODO on air 세션 준비 fiber 유저 준비 gorm 외래키 준비 아키텍쳐 참고 https://blog.puppyloper.com/menus/Golan

Hangyeol Shin 6 Sep 14, 2022