Vagrant 我能';t连接到一个流浪处理的VM:`ssh`可执行文件在%PATH%的任何目录中都找不到,但我有它

Vagrant 我能';t连接到一个流浪处理的VM:`ssh`可执行文件在%PATH%的任何目录中都找不到,但我有它,vagrant,virtual-machine,apache-storm,vagrant-windows,Vagrant,Virtual Machine,Apache Storm,Vagrant Windows,我是一个全新的流浪者,我有以下问题。我正在使用Windows8.1 我已完成以下操作: 1) 首先,我已从github将其下载到主机的文件夹中,地址如下: git clone https://github.com/Udacity/ud381 2) 然后我表演: vagrant up 下载了包含来宾虚拟机的“流浪者”框 现在,当我执行“向上游荡”命令时,我获得以下消息: C:\Users\Andrea\Documents\workspaces\Real-Time\ud381>vagran

我是一个全新的流浪者,我有以下问题。我正在使用Windows8.1

我已完成以下操作:

1) 首先,我已从github将其下载到主机的文件夹中,地址如下:

git clone https://github.com/Udacity/ud381
2) 然后我表演:

vagrant up
下载了包含来宾虚拟机的“流浪者”框

现在,当我执行“向上游荡”命令时,我获得以下消息:

C:\Users\Andrea\Documents\workspaces\Real-Time\ud381>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'udacity/ud381' is up to date...
==> default: There was a problem while downloading the metadata for your box
==> default: to check for updates. This is not an error, since it is usually due

==> default: to temporary network problems. This is just a warning. The problem
==> default: encountered was:
==> default:
==> default: Failed connect to atlas.hashicorp.com:443; No error
==> default:
==> default: If you want to check for box updates, verify your network connectio
n
==> default: is valid and try again.
==> 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: 5000 => 5000 (adapter 1)
    default: 22 => 2222 (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: Warning: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => C:/Users/Andrea/Documents/workspaces/Real-Time/ud381
==> default: Machine already provisioned. Run `vagrant provision` or use the `--
provision`
==> default: flag to force provisioning. Provisioners marked to run always will
still run.
我认为这是正确的,但我不是绝对肯定,因为我似乎有一些警告信息,但它说:default:Machine booted and ready所以我认为它还可以(还可以吗?)

然后我尝试通过SSH执行vagrant SSHstation连接到它,但我得到了以下错误消息:

C:\Users\Andrea\Documents\workspaces\Real-Time\ud381>vagrant ssh
`ssh` executable not found in any directories in the %PATH% variable. Is an
SSH client installed? Try installing Cygwin, MinGW or Git, all of which
contain an SSH client. Or use your favorite SSH client with the following
authentication information shown below:

Host: 127.0.0.1
Port: 2222
Username: vagrant
Private key: C:/Users/Andrea/Documents/workspaces/Real-Time/ud381/.vagrant/machi
nes/default/virtualbox/private_key
Try installing Cygwin, MinGW or Git, all of which
contain an SSH client
在Google上搜索时,我发现要使用此语句,我需要将git路径输入到path环境变量中。我检查并设置了它,实际上在路径变量中,我有以下两个值:

C:\HashiCorp\Vagrant\bin;C:\Program Files\Git\bin
第一个是流浪路径,第二个是Git路径

所以这不是问题所在。在网上搜索时,我还发现了以下讨论:

发送到此链接以解决此类问题:

在这个链接中,它展示了如何将ssh.rb文件修改到此文件夹C:\vagrant\vagrant\embedded\lib\ruby\gems\1.9.1\gems\vagrant-1.0.3\lib\vagrant\ssh.rb

问题是,我没有此文件夹,而是类似以下内容:

C:\HashiCorp\Vagrant\embedded\lib\ruby\gems\2.0.0\gems\
该文件夹不包含vagrant-1.0.3\lib\vagrant**子文件夹(包含**ssh.rb文件),而是包含3个目录,分别命名为rake-0.9.6rdoc-4.0.0test-unit-2.0.0,它们不包含ssh.rb文件

搜索此文件时,我在以下文件夹中找到了2个不同的版本:

C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\kernel_v1\config

我认为,与本教程的区别可能取决于以下事实:它是指一个非常古老的Vagrant版本(已经4年了),我已经安装了Vagrant的1.7.4版本

所以我真的不知道我可以用SSH连接到由Vagrant处理的VM

你能帮我吗

Tnx

错误消息

C:\Users\Andrea\Documents\workspaces\Real-Time\ud381>vagrant ssh `ssh`
executable not found in any directories in the %PATH% variable. Is an 
SSH client installed?
声明您当前使用的cli(在windows下工作时可能是cmd或powershell)找不到已安装的ssh客户端。这意味着您的cli无法找到可以通过ssh连接到另一台服务器(在本例中是您的VagarntBox)的程序。
这是一个非常常见的场景,因为windows没有现成的ssh客户端(与ubuntu或osx不同)

AFAIK没有ssh程序/命令,您可以轻松安装并将其放入PATH,以便它可以与cmd一起工作

在这种情况下,您可能需要安装这些功能附带的另一个cli。这里有几个选项,它们也在错误消息中说明:

C:\Users\Andrea\Documents\workspaces\Real-Time\ud381>vagrant ssh
`ssh` executable not found in any directories in the %PATH% variable. Is an
SSH client installed? Try installing Cygwin, MinGW or Git, all of which
contain an SSH client. Or use your favorite SSH client with the following
authentication information shown below:

Host: 127.0.0.1
Port: 2222
Username: vagrant
Private key: C:/Users/Andrea/Documents/workspaces/Real-Time/ud381/.vagrant/machi
nes/default/virtualbox/private_key
Try installing Cygwin, MinGW or Git, all of which
contain an SSH client
我建议您使用Git Bash,因为您使用的是Git,所以您可能已经在系统上安装了Git Bash

因此,要执行
vagrant ssh
,您的第一步是启动Git Bash,方法是执行程序本身(Git附带的程序,在我的系统上可以在以下位置找到:
C:\program Files\Git\Git Bash.exe
),或者右键单击Windows资源管理器中的目录列表,然后选择
Git Bash here
(只有在Git安装时选中某个复选框,此选项才有效)。
它将打开一个新的cli,它可以使用类似linux的命令。 现在,您应该能够将cd刻录到vagrant目录并执行
vagrant ssh

您在问题中链接到的解决方案似乎不再有效,因为与git连接的ssh客户端的路径似乎已更改。

请参阅您找到的另一篇SO文章。
路径
路径已更改为:

C:\Program Files\Git\usr\bin
…所以在cmd中运行此命令:

set PATH=%PATH%;C:\Program Files\Git\usr\bin
相关的: