Laravel Homestead挂起了SSH auth方法:mac上的私钥

Sco*_*own 25 macos ssh vagrant laravel homestead

我似乎无法让Homestead运转起来.它挂在SSH身份验证方法:私钥.

Homestead VM启动.我可以去VirtualBox并打开终端窗口并使用vagrant:vagrant登录.

我不能流浪ssh,ssh vagrant@127.0.0.1:2204或ssh vagrant@127.0.0.1 -p 2204.

我的文件夹中没有一个显示在VM中,但VirtualBox表示它们已映射.

每次我流浪,我得到:

vagrant up
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Checking if box 'laravel/homestead' is up to date...
==> homestead-7: Clearing any previously set forwarded ports...
==> homestead-7: Fixed port collision for 80 => 8000. Now on port 2200.
==> homestead-7: Fixed port collision for 443 => 44300. Now on port 2201.
==> homestead-7: Fixed port collision for 3306 => 33060. Now on port 2202.
==> homestead-7: Fixed port collision for 5432 => 54320. Now on port 2203.
==> homestead-7: Fixed port collision for 22 => 2222. Now on port 2204.
==> homestead-7: Clearing any previously set network interfaces...
==> homestead-7: Preparing network interfaces based on configuration...
    homestead-7: Adapter 1: nat
    homestead-7: Adapter 2: hostonly
==> homestead-7: Forwarding ports...
    homestead-7: 80 (guest) => 2200 (host) (adapter 1)
    homestead-7: 443 (guest) => 2201 (host) (adapter 1)
    homestead-7: 3306 (guest) => 2202 (host) (adapter 1)
    homestead-7: 5432 (guest) => 2203 (host) (adapter 1)
    homestead-7: 22 (guest) => 2204 (host) (adapter 1)
==> homestead-7: Running 'pre-boot' VM customizations...
==> homestead-7: Booting VM...
==> homestead-7: Waiting for machine to boot. This may take a few minutes...
    homestead-7: SSH address: 127.0.0.1:2204
    homestead-7: SSH username: vagrant
    homestead-7: SSH auth method: private key
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
Run Code Online (Sandbox Code Playgroud)

我用我的钥匙在我的盒子上取代了宅基地不安全的私钥.我看到很多人得到警告:连接超时.重试......,但我没有那么远.

我在Mac 10.11.6上

任何帮助将不胜感激!

Jac*_*ack 87

我今天在macOS 10.12上遇到了同样的问题,并且试图找到修复程序丢失了6个小时.最后,在几次重新安装,重新启动和反复试验之后,我通过以下步骤以某种方式使其工作......

  1. 完全卸载并重新安装Vagrant,VirtualBox和Homestead.
  2. 确保homestead-7在VirtualBox UI中关闭该框
  3. 右键单击该homestead-7框,然后选择"设置"
  4. 点击"网络"
  5. 在"适配器1"下,应该连接到NAT,单击"高级"
  6. 勾选"Cable Connected"旁边的框
  7. 保存设置,并重新配置Homestead vagrant up --provision
  8. 运行vagrant reload --provision以重新配置机器

那应该是它!之后我能够通过SSH进入SSH,但无法通过浏览器查看Homestead站点(即使我已经配置了/etc/hosts文件),但是Mac的简单重启似乎解决了这个问题.

鉴于我不知道究竟是什么造成了这一点,这对我的情况可能只是一点运气,但让我知道你是如何继续前进的.

  • 第3-6步解决了我的问题!你是救生员@Jack! (17认同)
  • 步骤3-6解决了我的问题 - 但只是暂时的.销毁和重新创建vm每次都需要步骤3-6.在我的Homestead目录中更新Vagrant文​​件对我来说是最好的解决方案:https://github.com/mitchellh/vagrant/issues/7648#issuecomment-235282382 (9认同)
  • 步骤3-6.你救了我的一天!我不能给你+50肯定票吗? (3认同)
  • 伙计们,很高兴看到这有帮助!:-) (2认同)

ged*_*edq 8

我有这个问题.我在BIOS中启用了Vt-x并将其清除.


小智 6

  1. 打开VirtualBox UI,进入虚拟机。
  2. 按 Enter 键使系统继续引导。

然后你可以看到流浪者在继续。

  • 我爱你。该答案应标记为已接受的答案。 (2认同)

mix*_*_ru 5

流浪者 2.1.2

vagrant destroy然后vagrant up --provision为我工作。

我注意到它通常发生在新版本的 vagrant 发布时


小智 5

如果您使用的是 Windows,您已经完成了这里的所有操作,但仍然遇到问题,也许这就是您需要的解决方案。

以管理员身份打开命令提示符。键入bcdedit命令。你可能会发现hypervisorlaunchtype Auto。如果是这种情况,请键入bcdedit /set hypervisorlaunchtype off将其关闭。重新启动并重试。

希望这可以帮助。