Laravel Homestead在Mac上SSH认证方法中卡住:私钥

33

我似乎无法使Homestead运行。它在SSH认证方法:私钥处卡住了。

Homestead虚拟机已经启动。我可以打开VirtualBox的终端窗口并使用vagrant:vagrant登录。

我不能使用vagrant ssh、ssh vagrant@127.0.0.1:2204或ssh vagrant@127.0.0.1 -p 2204。

我的文件夹没有显示在虚拟机中,但VirtualBox显示它们已映射。

每次我使用vagrant up,都会出现以下情况:

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.

我已经使用我的密钥替换了Homestead不安全的私钥。许多人会收到“警告:连接超时,正在重试…”,但我没有遇到这种问题。

我使用的是Mac 10.11.6操作系统。

如果有任何帮助,将不胜感激!


你能打开VirtualBox并检查其中的虚拟机状态吗?它是否已经完成启动了? - Frederic Henri
已经启动。我可以打开VirtualBox虚拟机屏幕并登录为vagrant,密码为vagrant。 - Scott O-Town
12个回答

0
尝试以管理员权限从CMD调用vagrant up

0

如果你还卡在这里,这里有一个你可以快速排除的问题:

对我来说,问题是视频内存太小了,在Virtual Box中我的视频内存设置为4mb,最低要求是12mb,我将其设置为24mb(关闭虚拟机),然后再次运行vagrant up,问题就解决了!


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接