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!

Issues
  • Update Hyper-V link.

    Update Hyper-V link.

    This brings it in line with the hyper-v overview page: https://github.com/hashicorp/vagrant/blob/main/website/content/docs/providers/hyperv/index.mdx

    opened by gilbertbw 0
  • `vagrant plugin install` returns

    `vagrant plugin install` returns "SSL_connect returned=1 errno=0 state=error: unexpected message"

    Hello,

    I'm running into the following problem. This is happening on two different machines running slightly different versions of Vagrant, OS and Kernel.

    Any help would be greatly appreciated, thanks!

    Vagrant / OS / Kernel Version

    Vagrant 2.2.10 / CentOS Linux 8 / 4.18.0-193.14.2.el8_2.x86_64 Vagrant 2.2.16 / CentOS Linux 7 / 3.10.0-1160.25.1.el7.x86_64

    Steps to reproduce

    $ vagrant plugin install vagrant-vbguest
    $ vagrant plugin install vagrant-vbguest --plugin-clean-source --plugin-source https://rubygems.org
    

    Expected behavior

    Install the plugin.

    Actual behavior

    $ vagrant plugin install vagrant-vbguest
    Installing the 'vagrant-vbguest' plugin. This can take a few minutes...
    Vagrant failed to load a configured plugin source. This can be caused
    by a variety of issues including: transient connectivity issues, proxy
    filtering rejecting access to a configured plugin source, or a configured
    plugin source not responding correctly. Please review the error message
    below to help resolve the issue:
    
      SSL_connect returned=1 errno=0 state=error: unexpected message (https://gems.hashicorp.com/specs.4.8.gz)
    
    Source: https://gems.hashicorp.com/
    

    Debug output

    $ vagrant plugin install vagrant-vbguest &> log
    

    Gist

    Additional Things

    The following work:

    $ wget -v https://gems.hashicorp.com/specs.4.8.gz
    $ wget -4 https://gems.hashicorp.com/specs.4.8.gz
    $ curl https://gems.hashicorp.com/specs.4.8.gz
    

    I even tried to disable IPv6 (as explained in #8795), but it did not resolve the issue:

    $ sudo sysctl -w net.ipv6.conf.all.disable_ipv6
    $ sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
    $ ip a | grep inet6
    

    References

    opened by ndejay 0
  • `vagrant up` crashes with `rsa_compat_build_request': undefined method '[]' for nil:NilClass (NoMethodError)`

    `vagrant up` crashes with `rsa_compat_build_request': undefined method '[]' for nil:NilClass (NoMethodError)`

    Vagrant version

    Vagrant 2.2.16

    Host operating system

    CentOS Linux release 8.3.2011

    Guest operating system

    Cisco IOS-XE 16.09.07

    Vagrantfile

    Vagrant.configure("2") do |config|
      config.vm.provider "virtualbox" do |vb|
        vb.gui = true
        vb.customize ["modifyvm", :id, "--graphicscontroller", "vmsvga"]
      end
      config.vm.define "router1" do |router1|
        router1.vm.box = "cisco/csr1000v"
        # Turn off shared folders
        router1.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true
        # Do not try to insert new SSH key
        router1.ssh.insert_key = false
        # Give the VM time to boot as Vagrant cannot tell when it is booted
        router1.vm.boot_timeout = 900
        router1.vm.network :private_network, virtualbox__intnet: "link1", ip: "192.168.50.21", auto_config: false, nic_type: "virtio"
        router1.vm.network "forwarded_port", guest: 22, host: 20001
        router1.trigger.after :up do |trigger|
          trigger.info = "Configuring interfaces"
          trigger.run = {inline: "./configure_ips.py -P 20001 127.0.0.1"}
        end
      end
    

    Debug output

    https://gist.github.com/ggiesen/7d97219467a4ebb3d82899262963eb9a

    The Gist contains 3 files:

    1. vagrant_up_router1-debug-1.txt - The first time vagrant up router1 is run
    2. vagrant_up_router1-debug-2.txt - The second time vagrant up router1 is run
    3. vagrant_ssh_router1-debug.txt - Then vagrant ssh router1 is run

    Expected behavior

    Bring up box

    Actual behavior

    The first time I run vagrant up router1, vagrant provisions the VM, and then crashes with the following error:

    /opt/vagrant/embedded/gems/2.2.16/gems/vagrant-2.2.16/lib/vagrant/patches/net-ssh.rb:10:inrsa_compat_build_request': undefined method []' for nil:NilClass (NoMethodError)

    The VM is left running, however, and I can run vagrant up router1 a second time and finishes running the trigger. I also encounter no issues using vagrant ssh router1

    If I use password-based authentication, vagrant does not crash (but I have to log into all devices manually).

    Steps to reproduce

    1. Use above Vagrantfile with Cisco CSR1000v box built using https://github.com/hpreston/vagrant_net_prog
    2. Run vagrant up router1
    opened by ggiesen 0
  • Vagrant crashes after provisioning when trying to write box metadata to file box_meta

    Vagrant crashes after provisioning when trying to write box metadata to file box_meta

    Vagrant version

    Vagrant 2.2.14, 2.2.16

    Host operating system

    Windows 10

    Guest operating system

    Debian 9, Debian 10

    Vagrantfile

    # -*- mode: ruby -*-
    # vi: set ft=ruby :
    
    Vagrant.configure("2") do |config|
      config.vm.box = "generic/debian10"
    end
    

    Debug output

    https://gist.github.com/mmohrwinkel/774f266ffade8ff04c8eb17c4d49b4de

    Expected behavior

    The box should start normally and I should be able to login via vagrant ssh afterwards

    Actual behavior

    The box shuts down after all provisioning is done. When vagrant tries to write into the file box_meta, it says it doesn't have the rights to write into the file. The error message thrown is the following, for the full stacktrace please refer to the gist link provided above:

    C:/HashiCorp/Vagrant/embedded/gems/2.2.16/gems/vagrant-2.2.16/plugins/commands/up/middleware/store_box_metadata.rb:27:in `initialize': Permission denied @ rb_sysopen - D:/test/.vagrant/machines/default/virtualbox/box_meta (Errno::EACCES)

    Steps to reproduce

    1. create new folder on any of my disks or an external drive
    2. vagrant init generic/debian10
    3. vagrant up

    Steps I unsuccessfully tried so far:

    • uninstalling vagrant and reinstalling it after rebooting
    • uninstalling vagrant, deleting vagrant.d in home folder and reinstalling after rebooting
    • uninstalling vagrant, uninstalling ruby, deleting vagrant.d and everything looking remotely like ruby and then reinstalling vagrant after rebooting
    • checked file permissions, they are the same on my colleagues machine, where vagrant works just fine
    • vagrant may have run once in a shell that had administrative privileges
    • please help, I'm desperate

    References

    • none I could find unfortunately
    opened by mmohrwinkel 3
  • chore: updates hashiconf alert banner data

    chore: updates hashiconf alert banner data

    DO NOT MERGE until June 8th at 3:30 PST.


    Updates the alert banner data for hashiconf europe going live.

    website 
    opened by kendallstrautman 0
  • Ansible version detection doesn't work with current ansible versions

    Ansible version detection doesn't work with current ansible versions

    Vagrant version

    2.2.14

    Host operating system

    Ubuntu 20.04.2 LTS

    Guest operating system

    Ubuntu 20.04.2 LTS

    Vagrantfile

    config.vm.provision :ansible do |ansible|
        ansible.version = "[core 2.11.1]"
      end
    

    Left out everything not required for this issue.

    Expected behavior

    ansible version matches

    Actual behavior

    ansible version reported as not matching

    Steps to reproduce

    1. Install ansible version that has the bug
    2. Specify ansible

    How to fix

    This is not necessarily a bug in vagrant, but rather a bug in ansible, check https://github.com/ansible/ansible/issues/74875 However, vagrant's version check for ansible could be made more resilient by adding a whitespace trim here:
    https://github.com/hashicorp/vagrant/blob/9e706d9d4c0d58ff03f3f8bcbd125481b0a66377/plugins/provisioners/ansible/provisioner/host.rb#L110-L132 and here

    https://github.com/hashicorp/vagrant/blob/9e706d9d4c0d58ff03f3f8bcbd125481b0a66377/plugins/provisioners/ansible/provisioner/guest.rb#L74-L91

    Workaround in the meantime

    When specifying ansible.version option, add a trailing space to the version string.

    References

    https://github.com/ansible/ansible/issues/74875

    opened by FloSchwalm 0
  • ensure that the shell provisioner only emits complete output lines to the ui

    ensure that the shell provisioner only emits complete output lines to the ui

    partial lines are buffered until they are complete (have a line ending)

    I'm not very happy how I've implemented the Proc stuff, please let me known if there is a more idiomatic way of doing this!

    this closes https://github.com/hashicorp/vagrant/issues/11047

    My test Vagrantfile:

    Vagrant.configure(2) do |config|
      config.vm.box = 'ubuntu-20.04-amd64'
      config.vm.provision 'shell', inline: 'python3 /vagrant/emit-partial-output.py --lines 1 --length 4 --no-stderr', name: 'partial-lines'
    end
    

    Here's the result before this PR:

    $ vagrant provision
    ==> default: Running provisioner: partial-lines (shell)...
        default: Running: script: partial-lines
        default: #
        default:  
        default: l
        default: i
        default: n
        default: e
        default:  
        default: 0
        default: 0
        default: 0
        default: 1
        default:  
        default: #
    

    And after:

    $ vagrant provision
        default: # line 0001 #
    

    I'm so happy to get this bug resolved! This has been haunting me for ages!

    opened by rgl 0
  • Vagrantfile is executed twice under WSL

    Vagrantfile is executed twice under WSL

    We observed that the evaluation of a Vagrantfile is different between WSL and other platforms. The prefix code before the "configure" blocks is executed twice on WSL which might result in different results between the platforms. It seems that it is executed as on a Linux host and as on a Windows host. I couldn't find any explanation for this behaviour in the "Load Order and Merging" section of the Vagrantfile documentation.

    Vagrant version

    vagrant version 2.2.16 (occured also on 2.2.15)

    Host operating system

    Windows version 1909 OS build 18363.1500 with Ubuntu 20.04.2 in WSL 1

    Guest operating system

    Vagrantfile

    puts "Call me once please"
    Vagrant.configure("2") do |config|
     
    end
    

    Debug output

    The debug output is available here: https://gist.github.com/ProfAccCH/b4698122eddceb6261b66434fab1dc5d

    Expected behavior

    I would expect that the "puts" statement is executed only once.

    Actual behavior

    We see the "puts" on WSL we see it twice. This will give problems to all non idempotent statements.

    Steps to reproduce

    1. call "vagrant up" for the provided Vagrantfile

    References

    opened by ProfAccCH 0
  • Enhancement Request: Global system properties for all providers

    Enhancement Request: Global system properties for all providers

    Is your feature request related to a problem? Please describe. In my use case, I usually switch between Windows (Virtualbox) and Debian (libvirt). The default settings that are provided for hardware is pretty enough other than memory. I need to specify each provider with the memory such as:

    config.vm.provider :virtualbox do |v|
      v.memory = 1024
    end
    
    config.vm.provider :libvirt do |v|
      v.memory = 1024
    end
    

    If one day I add VMware or Hyper-V in this Vagrantfile I need to add additional 3-6 lines which I don't want to. I want to keep provider specific details in the provider block such as Virtualbox's guest addition but nothing more than that.

    Describe the solution you'd like The implementation of this may vary but the logic behind this should be the same. Define one time and use with other providers. For example the following Vagrantfile might be the one:

    config.vm.system do |property|
      property.memory = 1024
    end
    
    config.vm.provider :virtualbox do |v|
      v.gui = true
    end
    
    config.vm.provider :hyperv do |v|
      v.ssh_info_public = false
    end
    
    config.vm.provider :libvirt do |v|
      v.storage :file, :size => '20G'
    end
    

    I did not think behind this Vagrantfile, yet I wanted to open this enhancment request to hear thoughts of Vagrant developers.

    Describe alternatives you've considered Of course Vagrantfile should be the first option to define system properties but I also think that environment variables might help. I use Vagrant in CI machine where I run different memory and CPU sizes with ENV[""], but I think I can see VAGRANT_SYSTEM_PROP_MEMORY? This is just an idea and I also did not sell out to the idea because of existence of ENV.

    Additional context Of course adding a global memory setting in Vagrantfile is not the only option I wanted to see, but this might be CPU count, disk size, publicly available network interfaces.

    enhancement 
    opened by BerkhanBerkdemir 0
Owner
HashiCorp
Consistent workflows to provision, secure, connect, and run any infrastructure for any application.
HashiCorp
A modern replacement for ‘ls’.

exa exa is a modern replacement for ls. README Sections: Options — Installation — Development exa is a modern replacement for the venerable file-listi

Benjamin Sago 13.5k Jun 6, 2021
cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.

cloc Count Lines of Code cloc counts blank lines, comment lines, and physical lines of source code in many programming languages. Latest release: v1.9

null 11.7k Jun 7, 2021
Command-line program to download videos from YouTube.com and other video sites

youtube-dl - download videos from youtube.com or other video platforms INSTALLATION DESCRIPTION OPTIONS CONFIGURATION OUTPUT TEMPLATE FORMAT SELECTION

youtube-dl 95.9k Jun 5, 2021
A code-searching tool similar to ack, but faster.

The Silver Searcher A code searching tool similar to ack, with a focus on speed. Do you know C? Want to improve ag? I invite you to pair with me. What

Geoff Greer 22.1k Jun 6, 2021
Magnificent app which corrects your previous console command.

The Fuck The Fuck is a magnificent app, inspired by a @liamosaur tweet, that corrects errors in previous console commands. Is The Fuck too slow? Try t

Vladimir Iakovlev 62.3k Jun 5, 2021
Git repository summary on your terminal

A command-line Git information tool written in Rust Onefetch is a command-line Git information tool written in Rust that displays project information

Ossama Hjaji 3.1k Jun 6, 2021
:mag: Google from the terminal

googler is a power tool to Google (web, news, videos and site search) from the command-line. It shows the title, URL and abstract for each result, whi

Piña Colada 5.2k Jun 6, 2021
:cherry_blossom: A command-line fuzzy finder

fzf is a general-purpose command-line fuzzy finder. It's an interactive Unix filter for command-line that can be used with any list; files, command hi

Junegunn Choi 37.1k Jun 6, 2021
:duck: DuckDuckGo from the terminal

ddgr ddgr is a cmdline utility to search DuckDuckGo (html version) from the terminal. While googler is extremely popular among cmdline users, in many

Piña Colada 2.1k Jun 5, 2021
A command-line benchmarking tool

hyperfine 中文 A command-line benchmarking tool. Demo: Benchmarking fd and find: Features Statistical analysis across multiple runs. Support for arbitra

David Peter 7.9k Jun 6, 2021
System monitoring dashboard for terminal

gtop System monitoring dashboard for terminal. Requirements Linux / OSX / Windows (partial support) Node.js >= v8 Installation $ npm install gtop -g D

Can Güney Aksakalli 8.5k Jun 5, 2021
🖼️ A command-line system information tool written in bash 3.2+

A command-line system information tool written in bash 3.2+ Neofetch is a command-line system information tool written in bash 3.2+. Neofetch displays

dylan 11.8k Jun 7, 2021
Linux Kernel Manager and Activity Monitor 🐧💻

Linux Kernel Manager and Activity Monitor ?? ?? The kernel is the part of the operating system that facilitates interactions between hardware and soft

Orhun Parmaksız 1.2k Jun 1, 2021
A fast CSV command line toolkit written in Rust.

xsv is a command line program for indexing, slicing, analyzing, splitting and joining CSV files. Commands should be simple, fast and composable: Simpl

Andrew Gallant 7.2k Jun 5, 2021