简体   繁体   中英

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

On win 10 pro I got VM, Vagrant and Homestead. After installation Docker Desktop VM, Vagrant stops working. Message from console:

 $ 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.

I know there is problem with sharing Hyper-V, or windows subsystem for Linux.

Please give the solution how you can work with them on same windows 10.

This thread here: https://github.com/hashicorp/vagrant/issues/11987 outlines the same problem. When WSL2 is enabled as part of the Docker install, the vagrant up command hangs.

The commenter here: https://github.com/hashicorp/vagrant/issues/11987#issuecomment-758089840 mentions that by disabling the VirtualMachinePlatform and restarting the machine, vagrant will work as normal again.

Of course, it's not an ideal solution especially if you need to use Docker but it does offer a temporary solution.

WSL2 does not play well with VirtualBox.

Since you are Win 10 Pro, why not using Hyper-V? You can see this benchmark , using Hyper-V is A LOT FASTER... You can follow this step-by-step guide to setup.

If you want to try out Docker+WSL2, you can use Official Laravel Sail. You can follow this tutorial to setup.

Answer https://github.com/hashicorp/vagrant/issues/11987#issuecomment-777256616 by johollmann works for me and others (according to likes): "My current workaround is to open VirtualBox Manager and select the virtual maschine, my vagrant is boooting up. It seems wiered but having the vm just in focus in VirtualBox GUI during vagrant up solves the problem"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM