title: Vagrant up fails with Warning: Remote connection disconnect. Retrying
body: <p>Upgraded to vagrant version 2.1.1 and latest centos/7 (virtualbox, 1803.01) and <em>$vagrant up</em> now fails to build just after the new key is loaded.  The Vagrant file being used has run fine on previous versions of vagrant (2.0.3).  </p>
  
  <p>Interestingly I am able to connect to the instance manually using vagrant, using the new key both using direct ssh and also with:</p>
  
  <blockquote>
    <p>$vagrant ssh nat</p>
  </blockquote>
  
  <p><strong>Things already tried:</strong><br>
  Extended timeout within vagrant <em>config.vm.boot_timeout = 1200</em><br>
  Uninstalled both vagrant and virtualbox + manually removing plugins and removing both <em>C:\Users\owner\.vagrand.d</em> and <em>C:\Users\owner\.VirtualBox</em> directories before reinstall<br>
  Tried older version of <em>nat.vm.box_version = "1704.01"</em> which previous worked.</p>
  
  <p><strong>Why not roll back?</strong><br>
  Initially I upgraded as I was having another issue which I will raise a separate thread about. Will link here once I have created it.  </p>
  
  <p><strong>Versions</strong><br>
  Host OS: Windows 7 Professional<br>
  Guest OS: centos/7 1803.01</p>
  
  <p>Vagrant Version: 2.1.1</p>
  
  <p>Vagrant Plugin list:<br>
  vagrant-hostmanager (1.8.8)<br>
  vagrant-hosts (2.8.1)<br>
  vagrant-proxyconf (1.5.2)<br>
  vagrant-reload (0.0.1)<br>
  vagrant-share (1.1.9)<br>
  vagrant-vbguest (0.15.1)  </p>
  
  <pre><code>$ vagrant up
  Bringing machine 'nat' up with 'virtualbox' provider...
  Bringing machine 'fei' up with 'virtualbox' provider...
  ==&gt; nat: Importing base box 'centos/7'...
  ==&gt; nat: Matching MAC address for NAT networking...
  ==&gt; nat: Checking if box 'centos/7' is up to date...
  ==&gt; nat: Setting the name of the VM: brand_nat_1526342206425_95671
  ==&gt; nat: Fixed port collision for 22 =&gt; 2222. Now on port 2200.
  ==&gt; nat: Clearing any previously set network interfaces...
  ==&gt; nat: Preparing network interfaces based on configuration...
      nat: Adapter 1: nat
      nat: Adapter 2: intnet
  ==&gt; nat: Forwarding ports...
      nat: 22 (guest) =&gt; 2200 (host) (adapter 1)
  ==&gt; nat: Running 'pre-boot' VM customizations...
  ==&gt; nat: Booting VM...
  ==&gt; nat: Waiting for machine to boot. This may take a few minutes...
      nat: SSH address: 127.0.0.1:2200
      nat: SSH username: vagrant
      nat: SSH auth method: private key
      nat: Warning: Connection aborted. Retrying...
      nat: Warning: Connection reset. Retrying...
      nat: Warning: Remote connection disconnect. Retrying...
      nat: Warning: Connection aborted. Retrying...
      nat:
      nat: Vagrant insecure key detected. Vagrant will automatically replace
      nat: this with a newly generated keypair for better security.
      nat:
      nat: Inserting generated public key within guest...
      nat: Removing insecure key from the guest if it's present...
      nat: Key inserted! Disconnecting and reconnecting using new SSH key...
      nat: Warning: Remote connection disconnect. Retrying...
      nat: Warning: Remote connection disconnect. Retrying...
      nat: Warning: Remote connection disconnect. Retrying...
      nat: Warning: Remote connection disconnect. Retrying...
      nat: Warning: Remote connection disconnect. Retrying...
      nat: Warning: Remote connection disconnect. Retrying...
      nat: Warning: Remote connection disconnect. Retrying...
      nat: Warning: Remote connection disconnect. Retrying...
      nat: Warning: Remote connection disconnect. Retrying...
      Timed out while waiting for the machine to boot. This means that
  Vagrant was unable to communicate with the guest machine within
  the configured ("config.vm.boot_timeout" value) time period.
  
  If you look above, you should be able to see the error(s) that
  Vagrant had when attempting to connect to the machine. These errors
  are usually good hints as to what may be wrong.
  
  If you're using a custom box, make sure that networking is properly
  working and you're able to connect to the machine. It is a common
  problem that networking isn't setup properly in these boxes.
  Verify that authentication configurations are also setup properly,
  as well.
  
  If the box appears to be booting properly, you may want to increase
  the timeout ("config.vm.boot_timeout") value.
  </code></pre>
  
  <p>Also showing my slightly sanitized vagrant file.  None of the scripts listed actually get run as the box fails before they are executed.</p>
  
  <pre><code># -*- mode: ruby -*-
  # vi: set ft=ruby :
  
  # abbreviated brand name
  BRAND_NAME = "brand"
  TOP_LEVEL_DOMAIN = ".some.dev"
  BOX_NAME = "centos/7"
  
  Vagrant.configure(2) do |config|
  
    config.vm.synced_folder ".", "/vagrant", type: "virtualbox"
    config.vm.boot_timeout = 1200
  
    if Vagrant.has_plugin?("vagrant-proxyconf")
      config.proxy.http     = "http://192.168.100.3:3128/"
      config.proxy.https    = "https://192.168.100.3:3128/"
      config.proxy.no_proxy = "localhost,127.0.0.1,.some.lan"
    end
  
    config.vm.provider :virtualbox do |vb|
      vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
      vb.memory = 2048
      vb.cpus = 2
      vb.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
    end
  
    config.vm.define "nat" do |nat|
      nat.vm.box = BOX_NAME
      nat.vm.network "private_network", ip: "10.0.0.2", virtualbox__intnet: true
      nat.vm.hostname = "nat.staging." + BRAND_NAME + TOP_LEVEL_DOMAIN
      nat.vm.provision :hosts, :sync_hosts =&gt; true
      nat.vm.provision "shell", path: "./scripts/aws_replication.sh"
      nat.vm.provision "shell", path: "./scripts/nat_ssh.sh"
      nat.vm.provision "shell", path: "./scripts/nat_staging.sh"
      nat.vm.provision "shell", path: "./scripts/nat_git_clone.sh"
      nat.vm.provision "shell", path: "./scripts/nat_set_ansible.sh"
    end
  
    config.vm.define "fei" do |fei|
      fei.vm.box = BOX_NAME
      fei.vm.network "private_network", ip: "10.0.0.4", virtualbox__intnet: true
      fei.vm.network "forwarded_port", guest: 80, host: 80, auto_correct: true
      fei.vm.network "forwarded_port", guest: 443, host: 443, auto_correct: true
      fei.vm.network "forwarded_port", guest: 9000, host: 9000, auto_correct: true
      fei.vm.provision :hosts, :sync_hosts =&gt; true
      fei.vm.hostname = BRAND_NAME + ".staging" + TOP_LEVEL_DOMAIN
      fei.vm.provision "shell", path: "./scripts/aws_replication.sh"
      fei.vm.provision "shell", path: "./scripts/non-nat_key_staging.sh"
    end
  end
  </code></pre>