Anik Barua
Anik Barua

Reputation: 3461

Multiple VMs on your local machine (Windows 10)

I am new in using docker and I am trying to implement SWARM according to this tutorial - https://docs.docker.com/get-started/part4/#create-a-cluster

The tutorial starts with -

  1. Launch Hyper-V Manager

  2. Click Virtual Switch Manager in the right-hand menu

  3. Click Create Virtual Switch of type External

I am using Windows 10 PRO and I cannot use Hyper-V Manager and Docker terminal at the same time. Because if I activate Hyper-V and then start docker terminal, my PC shows an error and shut down automatically.

So, I tried to create a virtual machine without Hyper-V by following code

$ docker-machine create -d hyperv --hyperv-virtual-switch "myswitch" myvm1

and as expected I got this error -

Wrapper Docker Machine process exiting due to closed plugin server (connection is shut down)
Error with pre-create check: "read tcp 127.0.0.1:50588->127.0.0.1:50587: wsarecv: `An existing connection was forcibly closed by the remote host."`

So, is there any alternative solution how can I proceed or to use Hyper-V Manager in Windows 10 without such problem.

Thanks a lot for your time :)

Upvotes: 0

Views: 629

Answers (1)

Tarun Lalwani
Tarun Lalwani

Reputation: 146630

Virtualbox and Hyperv don't work together. Since you are using docker quickstart terminal you should be using VirtualBox for the VM

$ docker-machine create -d virtualbox  swarmanager1
$ docker-machine create -d virtualbox  nodes1
$ docker-machine create -d virtualbox  nodes2

Once done you switch to manager node

$ eval $(docker-machine env swarmanager1)
$ docker swarm init --advertise-addr eth0

This will give you a token command and you need to execute them for each node

$ eval $(docker-machine env nodes1)
$ docker <swarm command from manager>

Upvotes: 2

Related Questions