Homestead 启动不了,启动的时候一直停留在 SSH auth method: private key

我是git clone https://github.com/laravel/homestead.git Homestead

生成了Homestead.yaml配置文件(我本机IP是192.168.199.17),内容如下:
ip: "192.168.1.254"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:

  • ~/.ssh/id_rsa
    folders:
  • map: E:\www\vagrant
    to: /home/vagrant/Code
    sites:
  • map: homestead.app
    to: /home/vagrant/Code/Laravel/public
    databases:
  • homestead

我有vagrant box add laravel/homestead,vagrant box list也有显示这个添加好了这个box。

vagrant up启动结果如下所示:

E:\Program Files\Homestead>vagrant up
Bringing machine 'homestead' up with 'virtualbox' provider...
==> homestead: Clearing any previously set network interfaces...
==> homestead: Preparing network interfaces based on configuration...
homestead: Adapter 1: nat
homestead: Adapter 2: hostonly
==> homestead: Forwarding ports...
homestead: 80 (guest) => 8000 (host) (adapter 1)
homestead: 443 (guest) => 44300 (host) (adapter 1)
homestead: 3306 (guest) => 33060 (host) (adapter 1)
homestead: 5432 (guest) => 54320 (host) (adapter 1)
homestead: 22 (guest) => 2222 (host) (adapter 1)
==> homestead: Running 'pre-boot' VM customizations...
==> homestead: Booting VM...
==> homestead: Waiting for machine to boot. This may take a few minutes...
homestead: SSH address: 127.0.0.1:2222
homestead: SSH username: vagrant
homestead: 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: SSH auth method: private key,过了四五分钟后,就显示后面的内容,请问如何解决?

《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
讨论数量: 15
Lonexw
  1. 直接打开 Virtual Box 查看一下虚拟机的启动状态和启动日志,看一下网络的设置是否正确;
  2. 直接 ssh 登录一下,看能不能正常登录?
7年前 评论

@JobsLong 谢谢回复。思路很对,在VB手动启动,发现是cup的vt没开启。现在解决了,解决办法:进入BOIS,将intel virtual technology设置为enable,原来是disable

7年前 评论
OMGZui

@樵夫 请问怎么进入VB的BOIS进行修改

7年前 评论

@OMGZui 不是修改VB的BOIS,是改你的电脑的BOIS,开启那个虚拟技术支持

7年前 评论

我的问题 和你的 一毛一样 但是 我的bois已经 设置好了啊 还是安装不上 我这个 就是昨晚可能没有正常关机 今早起来就这样了 搞死人 各种重装就是 不行 不知道怎么回事 不知道有没有还有这种情况的 哎

7年前 评论

@成成 我的和你一样,不知你现在解决了么?

7年前 评论

@wwhu668
已解决

> vagrant ssh-config
Host homestead-7
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile D:/Homestead/.vagrant/machines/homestead-7/virtualbox/private_key
  IdentitiesOnly yes
  LogLevel FATAL
  ForwardAgent yes

移除文件D:/Homestead/.vagrant/machines/homestead-7/virtualbox/private_key

运行vagrant up(vagrant会生成一个新insecure_private_key文件)

参考

7年前 评论

@wwhu668 我在D:/Homestead/.vagrant/machines/homestead-7/virtualbox/ 这个位置没有private_key

file

7年前 评论

@caiqihuang 这个就不知道了,你看下 →_→ 这里有没有你需要的答案。

7年前 评论

@wwhu668 已经解决了,在Oracle VM VirtualBox设置网络就不会卡在那里了。

7年前 评论
Summer

@caiqihuang
@wwhu668
@樵夫 感谢几位的分享。

搜索进来的同学可以看这里 Homestead 启动时 SSH auth method: private key 解决方案汇总

6年前 评论

@caiqihuang 我在D:/Homestead/.vagrant/machines/homestead-7/virtualbox/ 这个位置也没有private_key,设置VirtualBox勾选“接入网线”也不行--

5年前 评论

@wwhu668 为什么我的开启了也没有解决呢?

5年前 评论

@wwhu668 为什么我的开启了也没有解决呢?

@caiqihuang 怎么设置这个网络啊, 我设置了可是 还是没有 private_key 问题, 你是怎么设置的啊》?

5年前 评论

已解决,关了防火墙就好了

4年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!