Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vagrant Windows - ssh_exchange_identification: read: Connection reset by peer

It seems I can't SSH to my virtual box.

I have a virtual box running with Win7. The host PC is also in Win7. The virtual box was created through Vagrant with the following Vagrantfile.

Vagrant.configure("2") do |config|  
    config.vm.box = "http://aka.ms/vagrant-win7-ie11"  
end

Open cmd. Go to the root folder of the VagrantFile. Execute the following command:

vagrant up

cmd displays:

Bringing machine 'default' up with 'virtualbox' provider...  
==> default: Clearing any previously set forwarded ports...  
==> default: Clearing any previously set network interfaces...  
==> default: Preparing network interfaces based on configuration...  
    default: Adapter 1: nat  
==> default: Forwarding ports...  
    default: 22 (guest) => 2222 (host) (adapter 1)  
==> default: Booting VM...  
==> default: Waiting for machine to boot. This may take a few minutes...  
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant  
    default: SSH auth method: private key

Timed out while waiting for the machine to boot...

Time out appears though the virtual box has already finished the boot. (Checking via VirtualBox Manager)

Execute the following command:

vagrant ssh

cmd displays:

ssh_exchange_identification: read: Connection reset by peer  

While debugging the vagrant ssh, I may have found some useful logs:

INFO subprocess: Starting process: ["C:\\Program Files\\Git\\usr\\bin/ssh.EXE"]

INFO ssh: Invoking SSH: ss ["[email protected]", "-p", "2222", "-o", "Compression=yes", "-o", "DSAAuthentication=yes", "-o", "LogLevel=FATAL", "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", "-o", "IdentitiesOnly=yes", "-i", "C:/Users/hostpcname/.vagrant.d/insecure_private_key"]  

Can you suggest some ways on how to get out of this? I've tried the non-Windows image - hashicorp/precise64, and it worked fine.

like image 325
Back2WorkMinion Avatar asked Jul 12 '16 11:07

Back2WorkMinion


1 Answers

I have the same issue. Do by follow this step and working for me.

vagrant reload

and

vagrant ssh

again and working fine

like image 133
Xman Classical Avatar answered Sep 19 '22 12:09

Xman Classical