- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 Vagrant 的新手,我遇到了以下问题。我使用的是 Windows 8.1。
我做了以下操作:
首先,我通过以下语句将其从 github 下载到我的主机的文件夹中:
然后我执行了:
Vagrant 起来
下载了包含 guest 虚拟机的 Vagrant Box
现在当我执行 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.
我认为这是正确的,但我对此并不绝对确定,因为我似乎有一些警告消息,但它说:默认:机器启动并准备就绪!所以我认为它是好的(可以吗?)
然后我尝试通过 SSH 执行 vagrant ssh 语句来连接到它,但收到此错误消息:
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
在 Google 上搜索,我发现要使用此语句,我需要将 git 路径放入 PATH 环境变量中。我检查并设置了它,事实上在 PATH 变量中我有这两个值:
C:\HashiCorp\Vagrant\bin;C:\Program Files\Git\bin
第一个是 vagrant 路径,第二个是 Git 路径。
所以这不是问题。在线搜索我还发现了这个 StacOverflow 讨论:
`ssh` executable not found in any directories in the %PATH%
针对此类问题发送到此链接:https://gist.github.com/haf/2843680
在此链接中,它展示了如何将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.6、rdoc-4.0.0 和 test-unit-2.0.0.0,不包含 >ssh.rb 文件。
搜索此文件,我在这些文件夹中发现了 2 个不同的版本:
C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\kernel_v1\config
和
C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\kernel_v2\config
我认为也许与教程的差异可能取决于它引用了一个非常旧的 Vagrant 版本(已有 4 年历史),并且我已经安装了 1.7.4 版本 Vagrant 。
那么如何通过 SSH 连接到 Vagrant 处理的虚拟机?
最佳答案
错误信息
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 连接到另一台服务器(在本例中为 vagrantbox)的程序。
这是一个非常常见的场景,因为 Windows 没有附带开箱即用的 ssh 客户端(与 ubuntu 或 osx 不同)。
据我所知,没有任何 ssh 程序/命令可以轻松安装并放入 PATH 中,以便它可以与 cmd 一起使用。
在这种情况下,您可能想要做的是安装具有这些功能的不同 cli。这里有几个选项,它们也在错误消息中说明:
Try installing Cygwin, MinGW or Git, all of which
contain an SSH client
我建议您使用 Git Bash,自从您使用 git 以来,您可能已经在系统上安装了它。
因此,要执行vagrant ssh
,您的第一步将是通过执行程序本身来启动 Git Bash(它随 git 一起提供,在我的系统上可以在以下位置找到:C:\Program Files\Git\git-bash.exe
)或右键单击 Windows 资源管理器中的目录列表并选择 Git Bash here
(这仅在您选中某个框时才有效Git 安装后)。
它将打开一个新的 cli,它可以使用类似 linux 的命令。您现在应该能够进入 vagrant 目录并执行 vagrant ssh
。
您在问题中链接到的解决方案似乎不再有效,因为与 git 通信的 ssh 客户端的路径似乎已更改。
关于vagrant - 我无法连接到 Vagrant 处理的虚拟机 : `ssh` executable not found in any directories in the %PATH%,,但我有它,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33412239/
由于我在一个团队中工作,我想让与 vagrant(和 Chef-solo)一起工作的过程尽可能顺利。 当团队中的某人更改厨师食谱、角色或其他任何内容时,我希望所有其他团队成员通过在下一个“Vagran
在学习了几天之后,我很高兴能够成功设置我的 VM 并运行 Laravel 起始页。在那里很开心:) 有人可以澄清“何时”使用 Vagrant 函数。我的问题: 如果我打算关闭我的电脑,你应该使用 ha
如果我更改了配置脚本或更糟的基本操作系统,有没有办法强制 vagrant 重新配置或重新下载基本框?我试图改变 config.vm.box和 config.vm.box_url ,但是 vagrant
默认情况下,vagrant将框提取到用户主驱动器-%HOMEDRIVE%\.vagrant.d\boxes。这是在网络位置上。虽然有利于可靠存储,但速度非常慢。 如何更改盒子的位置? 最佳答案 当然。
我的系统上有许多测试 Vagrant 盒,我正在整理它们。我安装了插件,例如vagrant plugin install vagrant-hostsupdater和vagrant plugin ins
我的系统上有许多测试 Vagrant 盒,我正在整理它们。我安装了插件,例如vagrant plugin install vagrant-hostsupdater和vagrant plugin ins
我在理解他们网站上的 vagrant 工作流程时遇到了一些麻烦。 我之前一直在做一个项目,经历了更改目录和设置 vagrant box 等的整个过程。我什至运行了 bundle install 来安装
我在一个盒子上有一些相当复杂的配置,之后我想以编程方式做等效于 vagrant reload 的事情。 . 我见过的最好的解决方案是 here ,但是该链接上的代码似乎在 Vagrant 1.4+ 上
我无法在 Windows 7 机器上在我们的公司代理后面执行 vagrant up(或 vagrant add)。我尝试过使用和不使用 http_proxy/https_proxy 环境变量。我尝试将
是否可以将配置脚本中的值返回给 vagrant? response = config.vm.provision( "shell", path: "script.sh" ) if response =
这两个 Vagrant 插件有什么区别?我正在使用 vagrant-hostmanager,它可以更新主机上的/etc/hosts 文件,以及 guest 机器上的文件,支持多机 vagrant 设置
我正在使用vagrant和ansible来配置虚拟机,并且工作正常。这个可笑的剧本克隆了一个git repo,安装了它并运行了一个服务守护进程。 我还希望有一个无所事事的命令,该命令执行一个单独的“更
在浏览 Vagrant 教程时,我看到了两种在主机和 guest 计算机之间共享文件夹的选项 - 共享文件夹和同步文件夹。它们之间有什么区别? 或者,在 Vagrant 2 中,同步文件夹是共享文件夹
我在 Vagrant 中遇到同步文件夹的问题。我的配置非常简单: Vagrant.configure(2) do |config| config.vm.box = "ubuntu/xenial64
我正在尝试提供一个主-主MySQL对,并且只有它们都启动时才能正确配置它们。 Vagrant.configure("2") do |config| web.vm.box = "centos/7"
我已经在目录D:\vagrant\precise32\02-lamp\中执行了以下命令(在Windows中,使用Git Bash) $ vagrant box add precise32 http:/
尝试使用 Vagrant 的安装程序在 Windows 7 X64 上安装 Vagrant - vagrant_1.7.0.msi 安装正常,但无法使用 vagrant。在任何命令上,例如 vagra
我想禁用VirtualBox Guest Additions。我不会将它们用于文件夹同步等操作,对于我正在使用的盒子(例如centos / 7),无论如何它们都无法构建。有什么办法告诉流浪汉不要尝试在
我在 VirtualBox 上使用 Vagrant。昨天,我通过运行保存了我的项目的快照: $ vagrant snapshot save 'my-project-date-time' 今天,我对我想
我使用来自 vagrant init 的默认配置配置了 Vagrant (1.7.4)在 OS X (10.11.4) 上使用最新版本的 VirtualBox (5.0.16 r105871) 和最新
我是一名优秀的程序员,十分优秀!