Vagrant Windows - ssh_exchange_identification:读取:由peer重置连接

Bac*_*ion 12 windows ssh virtualbox vagrant

好像我无法通过SSH连接到我的虚拟机.

我有一个运行Win7的虚拟盒子.主机PC也在Win7中.虚拟框是通过Vagrant使用以下Vagrantfile创建的.

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

打开cmd.转到VagrantFile的根文件夹.执行以下命令:

vagrant up
Run Code Online (Sandbox Code Playgroud)

cmd显示:

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...
Run Code Online (Sandbox Code Playgroud)

虽然虚拟框已完成启动,但仍会显示超时.(通过VirtualBox Manager检查)

执行以下命令:

vagrant ssh
Run Code Online (Sandbox Code Playgroud)

cmd显示:

ssh_exchange_identification: read: Connection reset by peer  
Run Code Online (Sandbox Code Playgroud)

在调试vagrant ssh时,我可能找到了一些有用的日志:

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

INFO ssh: Invoking SSH: ss ["vagrant@127.0.0.1", "-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"]  
Run Code Online (Sandbox Code Playgroud)

你能提出一些方法来解决这个问题吗?我尝试过非Windows映像--hashicorp/precise64,它工作正常.

Xma*_*cal 9

我有同样的问题.请按照这一步并为我工作.

流浪汉重装

流浪汉ssh

再次,工作正常

  • 这只是一个临时解决方案,问题又回来了.这不能解决任何问题.. (5认同)
  • 我面临同样的问题.但这个没有固定我的. (3认同)