Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssh_exchange_identification: read: Connection reset by peer when vagrant ssh #78

Open
llealgt opened this issue Oct 6, 2017 · 23 comments

Comments

@llealgt
Copy link

llealgt commented Oct 6, 2017

I just installed vagrant ,virtualbox, forked and cloned the fullstack-nanodegree-vm repo, then vagrant up and the machine is running, however when i try to vagrant ssh to it, i get:
ssh_exchange_identification: read: Connection reset by peer
How can i fix this?

@pegahcarter
Copy link

If you're on windows, you might need to change your BIOS settings.

https://www.laptopmag.com/articles/access-bios-windows-10

Once you get into the settings, you have to change a 'disabled' to 'enabled'

@ilyarogov
Copy link

ilyarogov commented Nov 19, 2017

I am getting the exact same error on Windows 10 running virtualbox. What BIOS setting would I have to change? Thanks.

@twhetzel
Copy link

To enable virtualization.

@ilyarogov
Copy link

Getting virtualization to run isn't the problem. llelgt said he has the machine running as do I. The specific error is "ssh_exchange_identification: read: Connection reset by peer" when running vagrant up or vagrant ssh.

@kristianahonen
Copy link

I'm getting the same error, using Windows 7 Enterprise

@lehyjoseph
Copy link

Hello, i'm getting the same error on Windows 7 Ultimate

@adusumillisuresh
Copy link

getting below message:
vagrant : ssh_exchange_identification: read: Connection reset by peer
At line:1 char:1

  • vagrant ssh
  •   + CategoryInfo          : NotSpecified: (ssh_exchange_id...n reset by peer:String) [], RemoteException
      + FullyQualifiedErrorId : NativeCommandError
    
    

i am using windows 7 Enterprise and i installed virtualbox, vegrant in VDI machine. please let me know how to resolve the above issue.

@sruthiKommu5
Copy link

same problem here?
can u please suggest solution fast...please...

@andreeageorgescu
Copy link

Hello, I had the same issue, it was that the SSH key is insecure, you can see the issue if you do vagrant ssh --debug
I managed to fix it by restarting and enabling the virtualization in my BIOS.
https://support.lenovo.com/es/en/solutions/ht500006

vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> 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
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default:
    default: Guest Additions Version: 4.3.36
    default: VirtualBox Version: 5.2
==> default: Mounting shared folders...
    default: /vagrant => C:/Users/Andreea Georgescu/Desktop/Shell
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.

@xayyuu
Copy link

xayyuu commented Mar 21, 2018

I have the same problem.

Does anybody know how to slove?

Whether in linux or windows, i met the same error information:

ssh_exchange_identification: read: Connection reset by peer

@montao
Copy link

montao commented Apr 23, 2018

I have the same problem. Been trying for weeks to run vagrant. What if "Getting started" actually worked and wasn't a dependency hell.

@jeness
Copy link

jeness commented Jun 7, 2018

I have the same problem too.

vagrant ssh
ssh_exchange_identification: read: Connection reset by peer

I tried to vagrant halt and vagrant up again. But the problem is still there.
I search for solutions for a while and then this solution works for me.
If you still get the error message, it is really possible that your processor does not support virtualization. To solve this, you need to go to BIOS setting and enabled virtualization.
It is depend on your computer, but basically something like this (image is in the source link below).

source: http://mariosaputra.blogspot.com/2016/01/solved-vagrant-ssh-sshexchangeidentific.html

@zeshan77
Copy link

zeshan77 commented Feb 28, 2019

I had the same issue. The following commands worked for me.

vagrant halt
vagrant up
vagrant ssh

@Alex49er13
Copy link

same problem but my virtualization is enabled and it is not fixed anyone have any more ideas

@allthebytes
Copy link

turn off hyper-V (windows features).

@Alex49er13
Copy link

so this (for me) ended up being a painfully simple problem where my coding-enviroment was in users\desktop\overdrive\ and the overdrive was the problem i just had to move it out of the overdrive folder

@aleon1220
Copy link

I had the same issue. The following commands worked for me.

vagrant halt
vagrant up
vagrant ssh

this works

@jaschaio
Copy link

Having the same issue on MacOS v10.14.6.

The first time I set up a brand new machine with vagrant up it works. I can even exit the ssh shell and use vagrant ssh again without issues.

But as soon as I stop the machine (because of a computer restart for example) and try again running vagrant up the ssh fails with ssh_exchange_identification: read: Connection reset by peer.

vagrant ssh --debug doesn't displays anything insightful. The last command looks good:

DEBUG ssh: Checking key permissions: /Users/user/vm/project/.vagrant/machines/default/virtualbox/private_key
 INFO ssh: Invoking SSH: /usr/bin/ssh ["[email protected]", "-p", "2222", "-o", "LogLevel=FATAL", "-o", "Compression=yes", "-o", "DSAAuthentication=yes", "-o", "IdentitiesOnly=yes", "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", "-i", "/Users/user/vm/project/.vagrant/machines/default/virtualbox/private_key"]

The only solution I found is completely removing the virtual machine vagrant destroy and than setting it up again with vagrant up. This is of course crazy unproductive but the only workaround I have found.

@twhetzel
Copy link

Before restarting your computer, have you tried using vagrant suspend to pause the VM?

@jaschaio
Copy link

@twhetzel Yes, doesn't help. I can run vagrant suspend and vagrant resume temporary while the computer and VM are running without having the ssh issues, but as soon as I restart the computer (or even just have it in sleep mode) the next time I try I get the ssh error

@menadio
Copy link

menadio commented Aug 29, 2020

Guys I found a solution here https://stackoverflow.com/a/62928259/6150566

@babita-web
Copy link

Hello,
vagrant halt
vagrant up
vagrant ssh

@QGB
Copy link

QGB commented Feb 20, 2022

qgbe@ubuntu:"ssh -vv 192.168.1.3-p 30022
OpenSSH_7.2p2 Ubuntu-4ubuntu2.7,OpenSSL 1.0.2g
1Mar2016
debug1:Reading conf iguration data /etc/ssh/ssh_conf ig debug1:/etc/ssh/ssh_config line 19:Applying options for debug2:resolving "192.168.1.3"port 30022
debug2:ssh_comect_direct:needpriv 0
debug1:Comnecting to 192.168.1.3 【192.168.1.3】port 30022
debug1:Comection established.
debug1:key_load_public:No such file or directory debug1:identity file /home/qgb/。ssh/id_rsa type -1
debug1:key_load_public:No such file or directory debug1:identity file /home/qgb/。ssh/id_rsa-cert type
-1
debug1:key_load_public:No such file or directory debug1:identity file /home/qgb/。ssh/id_dsa type -1
debug1:key_load_public:No such file or directory debug1:identity file /home/ggb/。ssh/id_dsa-cert type -1
debug1:key_load_public:No such file or directory debug1:identity file /home/qgb/。ssh/id_ecdsa type -1
debug1:key_load_public:No such file or directory debug1:identity file /home/qgb/。ssh/id_ecdsa-cert type
-1
debug1:key_load_public:No such file or directory debug1:identity file /home/qgb/。ssh/id_ed25519 type -1
debug1:key_load_public:No such file or directory debug1:identity file /home/qgb/。ssh/id_ed25519-cert type
-1
debug1:Enabling compatibility mode for protocol 2.0
debug1:Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.7
ssh_exchange_identif ication:
Comection closed by remote host

30022 30022  192 168 1 3  port lnsed remote host

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests