Docker 在 Win 10 专业版上安装桌面后,VirtualBox 和 Vagrant 停止工作

VirtualBox and Vagrant stops working after Docker desktop instalation on Win10 pro

在 win 10 pro 上我得到了 VM、Vagrant 和 Homestead。 安装 Docker 桌面虚拟机后,Vagrant 停止工作。 来自控制台的消息:

 $ vagrant up --provision
Bringing machine 'homestead' up with 'virtualbox' provider...
==> homestead: Checking if box 'laravel/homestead' version '10.1.0' is up to date...
==> homestead: A newer version of the box 'laravel/homestead' is available and already
==> homestead: installed, but your Vagrant machine is running against
==> homestead: version '10.1.0'. To update to version '10.1.1',
==> homestead: destroy and recreate your machine.
==> 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.

我知道共享有问题 超级V, 或 Linux.

的 windows 子系统

请给出解决方案,如何在相同的 windows 10.

上使用它们

此处的线程:https://github.com/hashicorp/vagrant/issues/11987 概述了相同的问题。当 WSL2 作为 Docker 安装的一部分启用时,vagrant up 命令挂起。

这里的评论者:https://github.com/hashicorp/vagrant/issues/11987#issuecomment-758089840 提到通过禁用 VirtualMachinePlatform 并重新启动机器,vagrant 将再次正常工作。

当然,这不是一个理想的解决方案,特别是如果您需要使用 Docker 但它确实提供了一个临时解决方案。

WSL2 不能很好地与 VirtualBox 配合使用。

既然是Win 10 Pro,为什么不用Hyper-V呢? 您可以看到 benchmark,使用 Hyper-V 快得多... 您可以按照此 step-by-step guide 进行设置。

如果你想试用Docker+WSL2,你可以使用官方Laravel Sail。 您可以按照此 tutorial 进行设置。