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.
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.
I am on my laptop that has windows 10. I have VirtualBox 6.0.8 and Vagrant 2.2.4.
I tryed 4 diffrent boxes including one I builded using Chef and a more generic box that suposidly would work (hashicorp/precise64)
So I am confident the problem is somewhere else that in the vagrantfile.
I have virtualization active in my BIOS ... cheked twice.
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.
ssh-config says the following:
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
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
also tryed adding the cableconnected1 in the vagrant file even if the box is checked in the gui configuration ...
config.vm.provider "virtualbox" do |vb| vb.customize ["modifyvm", :id, "--cableconnected1", "on"]end
I checked if the insecure_private_key exists at the correct location and it does C:/Users/Utilisateur 1/.vagrant.d/insecure_private_key
I tryed using password authentification instead of ssh key but it froze as well so I turned it back to using ssk key.
I also tryed deleting knowhost file in the .ssh folder but it did nothing
Everytime i tryed something new I usedvagrant destroy then vagrant up --provision
I tryed to SSH inside the box while it was stalledssh 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=yesBut that gives me ssh_exchange_identification: read: Connection reset by peer
Starting the VM from the VB gui gives me a black screen and stalls at the same place
I uninstalled VirtualBox and Vagrant twice, destroyed and reloaded over 15 times and still get the same error what ever box i use.
So fare I tryed the following boxeshashicorp/precise64bento/ubuntu-18.04HomesteadAnd 1 other I deleted and don't remember the nameAll those baxes are claimed to work.
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 ...
Heres a log vagrant up --debug &> vagrant.log on my bento/ubuntu-18.04 VM https://transferxl.com/08vvkdTr6YJ5B2
I tryed simplefying my vagrant file to the minimum but that did not help
My vagrant file at the moment looks like this:
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]' ] endend
-- EDIT
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
config.ssh.private_key_path = ["C:/Users/Utilisateur\ 1/.vagrant.d/insecure_private_key"]config.ssh.insert_key = true
But that returned
vagrant destroy==> default: Loading Berkshelf datafile...==> default: Sharing cookbooks with VM==> default: Running cleanup tasks for 'berkshelf'... default: Are you sure you want to destroy the 'default' VM? [y/N] yThere are errors in the configuration of this machine. Please fixthe following errors and try again:SSH:* `private_key_path` file must exist: C:/Users/Utilisateur\ 1/.vagrant.d/insecure_private_key
So i changed it to
config.ssh.private_key_path = ["~/.vagrant.d/insecure_private_key"]config.ssh.insert_key = true
But it did not solve my original problem