如何解决Laravel Homestead挂在SSH身份验证方法上:Windows 10上安装了WSL2的私钥
我正在运行Windows 10(2004版,内部版本19041.388),其中在本地安装了Vagrant和Virtualbox。对于Laravel开发,我想使用Homestead,因为这是一种简单的设置方法。对于其他开发,我已经安装了WSL2。
每次我想启动Homestead VM时,都会得到这个消息(基本上与this question相同):
vagrant up --provision
Bringing machine 'homestead' up with 'virtualbox' provider...
==> homestead: Clearing any previously set forwarded ports...
==> 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: 4040 (guest) => 4040 (host) (adapter 1)
homestead: 5432 (guest) => 54320 (host) (adapter 1)
homestead: 8025 (guest) => 8025 (host) (adapter 1)
homestead: 9600 (guest) => 9600 (host) (adapter 1)
homestead: 27017 (guest) => 27017 (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.
它基本上挂了很长时间,然后给了我这个错误。我已经尝试过这些选项:
- 我重新安装了Vagrant,Virtualbox和Homestead。之后,我确保在Virtualbox中勾选
Cable connected
框,并使用--provision
选项启动homestead。 - 在我的BIOS中启用了英特尔虚拟化技术。
- 重新生成我的SSH密钥,并确保它与我的Homestead.yaml目录匹配
我的Homestead.yaml文件如下:
memory: 2048
cpus: 2
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: C:/Users/Bas/Projects
to: /home/vagrant/code
sites:
- map: someproject.test
to: /home/vagrant/code/someproject/public
php: '7.2'
databases:
- goeswerkt
features:
- mariadb: false
- ohmyzsh: false
- webdriver: false
是否可能无法在WSL2旁边运行Virtualbox实例?如果是这样,我该如何解决?
解决方法
关闭Hyper-V自动启动:
bcdedit /set hypervisorlaunchtype off
运行:vagrant destroy
清除:C:\Users\USER_NAME\VirtualBox VMs
(如果该框仍然存在)
重新启动并无所事事
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。