title: Vagrant freezes (timeouts) at SSH auth method: private key
body: <p>So - i googled this and found about 1 Million Issues regarding vagrant provisioning and ssh agents. I tried lots of solutions and nothing works. I tried adding options for the network adaptor (VirtualBox), destroying the machine, reinstalling vagrant and so on, everytime i need to run vagrant this thing blocks me from working.</p>
  <p>Now i work on a completely fresh OS Installation (Ubuntu 20.04)! I install VirtualBox 6.1 like instructed on the oracle website and downloaded the right vagrant binary from vagrantup.com/downloads.</p>
  <p>And again - vagrant manages it to fail right-away! So okay - lets face it - vagrant is buggy and should be replaced but there are projects where i wont get any budget to migrate to containers, so i need to make that setup work again - and hopefuly someone has a solution for me, that actually works.</p>
  <p>Okay - here the final <code>vagrant up</code> output:</p>
  <pre><code>Timed out while waiting for the machine to boot. This means that
  Vagrant was unable to communicate with the guest machine within
  the configured (&quot;config.vm.boot_timeout&quot; 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 (&quot;config.vm.boot_timeout&quot;) value.
  </code></pre>
  <p>So the machine runs but vagrant was not able to connect and run the provisioning. It basically downloaded the image and started it.</p>
  <p>So i try <code>vagrant ssh --debug</code></p>
  <p>The last lines i see:</p>
  <pre><code>Checking key permissions: ~/.vagrant.d/insecure_private_key
   INFO ssh: Invoking SSH: /tmp/.mount_vagran2MLjJR/usr/bin/ssh [&quot;vagrant@127.0.0.1&quot;, &quot;-p&quot;, &quot;2222&quot;, &quot;-o&quot;, &quot;LogLevel=FATAL&quot;, &quot;-o&quot;, &quot;Compression=yes&quot;, &quot;-o&quot;, &quot;DSAAuthentication=yes&quot;, &quot;-o&quot;, &quot;IdentitiesOnly=yes&quot;, &quot;-o&quot;, &quot;StrictHostKeyChecking=no&quot;, &quot;-o&quot;, &quot;UserKnownHostsFile=/dev/null&quot;, &quot;-i&quot;, &quot;~/.vagrant.d/insecure_private_key&quot;]
  </code></pre>
  <p>And thats it - the command will fail without further notice.</p>
  <p>So i can only kill the vm (shutdown using vagrant halt wont work either!) and try to get more logs:</p>
  <p>(just to make sure i re-installed the vbguest plugin)</p>
  <p><code>vagrant up --debug</code></p>
  <p>Okay - the screen-output looks like a loop. And i can only find &quot;Attemping SSH connection...&quot; with the given options (path to key, etc)</p>
  <p>After a few minutes (i gues the configured timeout) i can see:</p>
  <pre><code>INFO interface: Machine: error-exit [&quot;Vagrant::Errors::VMBootTimeout&quot;, &quot;Timed out while waiting for the machine to boot. This means that\nVagrant was unable to communicate with the guest machine within\nthe configured (\&quot;config.vm.boot_timeout\&quot; value) time period.\n\nIf you look above, you should be able to see the error(s) that\nVagrant had when attempting to connect to the machine. These errors\nare usually good hints as to what may be wrong.\n\nIf you're using a custom box, make sure that networking is properly\nworking and you're able to connect to the machine. It is a common\nproblem that networking isn't setup properly in these boxes.\nVerify that authentication configurations are also setup properly,\nas well.\n\nIf the box appears to be booting properly, you may want to increase\nthe timeout (\&quot;config.vm.boot_timeout\&quot;) value.&quot;]
  </code></pre>
  <p>Here is some config:</p>
  <pre><code>unless Vagrant.has_plugin?(&quot;vagrant-vbguest&quot;)
    raise 'vagrant-vbguest is not installed, see README.md!'
  end
  unless Vagrant.has_plugin?(&quot;vagrant-disksize&quot;)
    raise 'vagrant-disksize is not installed, see README.md!'
  end
  Vagrant.configure(&quot;2&quot;) do |config|
    # https://docs.vagrantup.com
    config.vm.box = &quot;ubuntu/bionic64&quot;
    config.disksize.size = &quot;25GB&quot;
  
    # forward http traffic
    config.vm.network &quot;forwarded_port&quot;, guest: 80, host: 8083
    # forward mysql
    config.vm.network &quot;forwarded_port&quot;, guest: 3306, host: 3308
    # forward xdebug
    config.vm.network &quot;forwarded_port&quot;, guest: 9000, host: 9000
    # forward elastic
    config.vm.network &quot;forwarded_port&quot;, guest: 9200, host: 9200
    # forward solr
    config.vm.network &quot;forwarded_port&quot;, guest: 8983, host: 8983
  
    config.vm.synced_folder &quot;.&quot;, &quot;/vagrant&quot;,
      type: &quot;virtualbox&quot;,
      id: &quot;vagrant-root&quot;,
      owner: &quot;vagrant&quot;,
      group: &quot;www-data&quot;,
      mount_options: [&quot;dmode=775,fmode=664&quot;]
  
    config.vm.provider &quot;virtualbox&quot; do |vb|
      vb.memory = &quot;8192&quot;
      vb.cpus = 4
      vb.customize [ &quot;modifyvm&quot;, :id, &quot;--uartmode1&quot;, &quot;disconnected&quot; ]
      vb.customize [ &quot;modifyvm&quot;, :id, &quot;--cableconnected1&quot;, &quot;on&quot; ]
    end
  
    config.vm.provision &quot;shell&quot;, path: &quot;config/bootstrap.sh&quot;
    config.vm.provision &quot;shell&quot;, path: &quot;config/solr.sh&quot;
    config.vm.provision &quot;shell&quot;, path: &quot;config/startup.sh&quot;, run: &quot;always&quot;
  
  end
  </code></pre>
  <p>My problem is - i have no idea how to solve this. I would be happy if i could disable the ssh authentication or use a password but i would need to connect to the vm to change it... Even if i could login using virtualbox i would only be able to fix my local installation. But there are other people as well working on that code and a solution should fix this.</p>
  <p>Just to sum this up once more:</p>
  <p>We deal with:</p>
  <ul>
  <li>A standard Ubuntu 20.04</li>
  <li>A standard VirtualBox Installation</li>
  <li>A original vagrant binary</li>
  </ul>
  <p><strong>Fresh installation</strong></p>
  <p><strong>wont work</strong></p>
  <p>Kind regards,
  Philipp</p>