【问题标题】:Laravel Homestead hangs at SSH auth method: private key on Windows 10 with WSL2 installedLaravel Homestead 在 SSH 身份验证方法中挂起:安装了 WSL2 的 Windows 10 上的私钥
【发布时间】:2020-12-02 00:03:16
【问题描述】:

我正在运行 Windows 10(版本 2004,内部版本 19041.388),我在本地安装了 Vagrant 和 Virtualbox。对于 Laravel 开发,我想使用 Homestead,因为它是一种简单的设置方法。对于其他开发,我安装了 WSL2。

每当我想启动 Homestead 虚拟机时,我都会得到这个(基本上与 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 选项启动宅基地。
  • 在我的 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 实例?如果是这样,我该如何解决这个问题?

【问题讨论】:

    标签: laravel windows-subsystem-for-linux homestead


    【解决方案1】:

    关闭 Hyper-V 自动启动: bcdedit /set hypervisorlaunchtype off

    运行:vagrant destroy 清除:C:\Users\USER_NAME\VirtualBox VMs 如果该框仍然存在

    重新启动并流浪

    【讨论】:

    • 在我重新打开 WSL 之前,这不会导致它无法使用吗?
    • 您使用的是虚拟盒提供程序,因此您不需要 hyper-v。
    猜你喜欢
    • 2017-02-18
    • 2017-04-19
    • 1970-01-01
    • 1970-01-01
    • 2019-10-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-17
    相关资源
    最近更新 更多