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

7
在 Windows 10 Pro 上,我安装了 VM、Vagrant 和 Homestead。但是,在安装 Docker Desktop VM 后,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.

我知道在分享Hyper-V或Windows子系统的时候会出现问题。

请提供解决方案,如何在同一台Windows 10上使用它们。

3个回答

3

以下是johollmann在此处提供的解决方案,经过测试适用于我和其他人(根据点赞数):

我的当前解决方法是打开VirtualBox Manager并选择虚拟机,然后vagrant就能正常启动了。这似乎很奇怪,但是在vagrant up期间,只需将虚拟机在VirtualBox GUI中置于焦点状态即可解决问题。


3

2

WSL2与VirtualBox不兼容。

既然您使用的是Win 10 Pro,为什么不使用Hyper-V呢? 您可以查看此基准测试,使用Hyper-V速度要快得多... 您可以按照此逐步指南进行设置。

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


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