title: VirtualBox 6.0.8, Vagrant 2.2.4 Hangs on SSH auth method: private key
body: <p>I am new to Vagrant. I am trying to get a suitable developement envirement in order to create a symfony project but for some reason, I can't seem to get this working. What ever machine i build i always get stuck at the "SSH auth method: private key" line.</p>
  
  <p>I made a lot of reading in the past 2 days and this problem seems to happend for various reasons. I tryed everything on satck overflow but just can't seem to pin point what is causing my setup to fail. </p>
  
  <p>I am on my laptop that has windows 10. I have VirtualBox 6.0.8 and Vagrant 2.2.4.</p>
  
  <p>I tryed 4 diffrent boxes including one I builded using Chef and a more generic box that suposidly would work (hashicorp/precise64)</p>
  
  <p>So I am confident the problem is somewhere else that in the vagrantfile.</p>
  
  <p>I have virtualization active in my BIOS ... cheked twice.</p>
  
  <p>I tryed using the git console, the windows cmd with and without admin permission as well as powershell (Just in case) and got the same result.</p>
  
  <p>ssh-config says the following:</p>
  
  <pre><code>Host default
    HostName 127.0.0.1
    User vagrant
    Port 2200
    UserKnownHostsFile /dev/null
    StrictHostKeyChecking no
    PasswordAuthentication no
    IdentityFile "C:/Users/Utilisateur 1/.vagrant.d/insecure_private_key"
    IdentitiesOnly yes
    LogLevel FATAL
  </code></pre>
  
  <p>I checked inside the VirtualBox gui in the config section and cable box is checked and ports seems to be forwarded 2200 to guest 22 or forwarded 2222 to guest 22 depending on the box I am trying. The farward always matched the ssh-config</p>
  
  <p>also tryed adding the cableconnected1 in the vagrant file even if the box is checked in the gui configuration ...</p>
  
  <pre><code>config.vm.provider "virtualbox" do |vb|
      vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
  end
  </code></pre>
  
  <p>I checked if the insecure_private_key exists at the correct location and it does C:/Users/Utilisateur 1/.vagrant.d/insecure_private_key</p>
  
  <p>I tryed using password authentification instead of ssh key but it froze as well so I turned it back to using ssk key.</p>
  
  <p>I also tryed deleting knowhost file in the .ssh folder but it did nothing</p>
  
  <p>Everytime i tryed something new I used
  vagrant destroy then vagrant up --provision</p>
  
  <p>I tryed to SSH inside the box while it was stalled
  ssh vagrant@127.0.0.1 -p 2200 -i ~/.vagrant.d/insecure_private_key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PasswordAuthentication=no -o IdentitiesOnly=yes
  But that gives me ssh_exchange_identification: read: Connection reset by peer</p>
  
  <p>Starting the VM from the VB gui gives me a black screen and stalls at the same place</p>
  
  <p>I uninstalled VirtualBox and Vagrant twice, destroyed and reloaded over 15 times and still get the same error what ever box i use.</p>
  
  <p>So fare I tryed the following boxes
  hashicorp/precise64
  bento/ubuntu-18.04
  Homestead
  And 1 other I deleted and don't remember the name
  All those baxes are claimed to work.</p>
  
  <p>I tryed adding the port_forward in the vagrantfile because that seemed to have helped other members with the same problem but I ended up with 2 port forwards and still stalled at the same place ...</p>
  
  <p>Heres a log vagrant up --debug &amp;> vagrant.log on my bento/ubuntu-18.04 VM 
  <a href="https://transferxl.com/08vvkdTr6YJ5B2" rel="nofollow noreferrer">https://transferxl.com/08vvkdTr6YJ5B2</a></p>
  
  <p>I tryed simplefying my vagrant file to the minimum but that did not help</p>
  
  <p>My vagrant file at the moment looks like this:</p>
  
  <pre><code>Vagrant.configure("2") do |config|
      #berkshelf
      config.berkshelf.enabled = true
  
      #box
      config.vm.box = 'bento/ubuntu-18.04'
      config.vm.network :private_network, ip: '192.168.33.200'
  
      #network
      config.vm.network :forwarded_port, guest: 80, host: 8080
  
      #chef
      chef_repo_path = './chef'
  
      config.vm.provision :chef_solo do |chef|
          chef.cookbooks_path = 'chef/cookbooks'
          chef.data_bags_path = 'chef/data_bags'
          chef.environments_path = 'chef/environments'
          chef.roles_path = 'chef/roles'
  
          chef.environment = 'vagrant'
          chef.run_list = [
              'role[webserver]'
          ]
      end
  
  end
  </code></pre>
  
  <p>-- EDIT</p>
  
  <p>As sugested by Strom in the comments bellow, in case the space in my windows username was the issu, I added the following in vagrant</p>
  
  <pre><code>config.ssh.private_key_path = ["C:/Users/Utilisateur\ 1/.vagrant.d/insecure_private_key"]
  config.ssh.insert_key = true
  </code></pre>
  
  <p>But that returned</p>
  
  <pre><code>vagrant destroy
  ==&gt; default: Loading Berkshelf datafile...
  ==&gt; default: Sharing cookbooks with VM
  ==&gt; default: Running cleanup tasks for 'berkshelf'...
      default: Are you sure you want to destroy the 'default' VM? [y/N] y
  There are errors in the configuration of this machine. Please fix
  the following errors and try again:
  
  SSH:
  * `private_key_path` file must exist: C:/Users/Utilisateur\ 1/.vagrant.d/insecure_private_key
  </code></pre>
  
  <p>So i changed it to </p>
  
  <pre><code>config.ssh.private_key_path = ["~/.vagrant.d/insecure_private_key"]
  config.ssh.insert_key = true
  </code></pre>
  
  <p>But it did not solve my original problem</p>