Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 807
Marcin Avatar asked Oct 14 '22 22:10

Marcin


People also ask

Can Docker and VirtualBox run together Windows 10?

Yes, you can run VirtualBox along with Docker Desktop if you have enabled the Windows Hypervisor Platform feature on your machine.

Does Docker interfere with VirtualBox?

Re: VirtualBox broken after installing/uninstalling Docker WSL2 will certainly interfere with VirtualBox, just as docker and Hyper-V do. You simply can't have any of them active and run a Windows Server vm at the same time.

Can I run Docker on Windows 10 pro?

You can install Docker on Windows 10 or 11 Professional and Enterprise editions by using the following steps. Download and install Docker Desktop and create a Docker account if you don't already have one.

Is Vagrant the same as VirtualBox?

VirtualBox is basically inception for your computer. You can use VirtualBox to run entire sandboxed operating systems within your own computer. Vagrant is software that is used to manage a development environment.


2 Answers

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.

like image 77
Andrew M Avatar answered Oct 18 '22 15:10

Andrew M


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"

like image 44
Gerrit Avatar answered Oct 18 '22 14:10

Gerrit