Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker-Machine create hyperv, Waiting for host to start, stuck #1378

Closed
dnbr2002 opened this issue Dec 3, 2017 · 10 comments
Closed

Docker-Machine create hyperv, Waiting for host to start, stuck #1378

dnbr2002 opened this issue Dec 3, 2017 · 10 comments

Comments

@dnbr2002
Copy link

dnbr2002 commented Dec 3, 2017

Expected behavior

PS C:\WINDOWS\system32> docker-machine create -d hyperv --hyperv-virtual-switch "Primary Virtual Switch" manager1
Running pre-create checks...
Creating machine...
(manager1) Copying C:\Users\Vicky.docker\machine\cache\boot2docker.iso to C:\Users\Vicky.docker\machine\machines\manag
er1\boot2docker.iso...
(manager1) Creating SSH key...
(manager1) Creating VM...
(manager1) Using switch "Primary Virtual Switch"
(manager1) Creating VHD
(manager1) Starting VM...
(manager1) Waiting for host to start...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: C:\Program Files\Doc
ker\Docker\Resources\bin\docker-machine.exe env manager1
PS C:\WINDOWS\system32>

Actual behavior

PS C:\WINDOWS\system32> docker-machine create -d hyperv --hyperv-virtual-switch "External Virtual Switch" Default
Running pre-create checks...
Creating machine...
(Default) Copying C:\Users\rss.docker\machine\cache\boot2docker.iso to C:\Users\rss.docker\machine\machines\Default\boot2docker.iso...
(Default) Creating SSH key...
(Default) Creating VM...
(Default) Using switch "External Virtual Switch"
(Default) Creating VHD
(Default) Starting VM...
(Default) Waiting for host to start...

Information

So I've followed information and documenatation from Docker here https://docs.docker.com/machine/drivers/hyper-v/
It actually mentions the issue Im having here but im not using Virtual box so the linked provided isn't very helpful.
https://docs.docker.com/machine/drivers/hyper-v/#3-reboot

Windows 10 professional with Hyper V
Docker version 17.09.0-ce, build afdb6d4
docker-machine.exe version 0.12.2, build 9371605

Steps to reproduce the behavior

I run a basic docker machine command to create as follows and this is what I get.

 docker-machine create -d hyperv --hyperv-virtual-switch "External Virtual Switch" Default

image

I've looked around, tried everything. I think because I had VirtualBox installed at one point, there's something that is messing this whole thing up, but I've tried everything to try and get that install removed cleanly and completely. I've even tried ethernet vs wireless on my virtual switch, no change. I enabled containers as a feature, no change. Obviously reboots have done nothing.

Maybe Im missing something on my network configs?

image

@dnbr2002
Copy link
Author

dnbr2002 commented Dec 3, 2017

If I look at my network adapter. Clearly my network adapter for the VM doesn't have IP addresses.

image

Why is that?

@dnbr2002
Copy link
Author

dnbr2002 commented Dec 8, 2017

So i was finally able to get docker-machine to create a VM in Hyper V. Sadly Im not really sure what, if anything really changed to make this happen. I think there might be bug in there for users that get updated from Windows 7 who may have had Docker Toolbox using VirtualBox. There's a hangup of somekind. Obviously I no longer had Docker Toolbox or VirtualBox installed but i came across a folder today in my profile for VirtualBox which I deleted. I also started up a an ubuntu VM from an iso just to see anything else run and get an IP address. So one of those 2 things may have flipped a switch back somewhere that got docker past where I was was getting stuck. It works normally now. This was really a pain in the ass though. Days I'll never get back. smh

@dnbr2002 dnbr2002 closed this as completed Dec 8, 2017
@dnbr2002
Copy link
Author

Also, if you've reached this post, just forget Docker-Machine and the old way of doing things altogether. Essentially your docker-machines are just a process now running in the background in windows 10 with hyper v. you do not physically need a host running docker that you can see in hyper v. That is 'old thinking' . So no more docker-machine. Move on. Just use Docker run, Or Docker Container Run. It's runs a host process in the background automagically. More on the web. Go find with Google. Just don't wast time with docker-machine like I did.

@timothy2005
Copy link

I also encountered this issue, and fixed it, I think the root cause is: the document is unclear.
to solve this:
Please make sure you have selected the correct network
There are several networks in the list, but probably there is only one is enabled
You may check the status in: Control Panel\Network and Internet\Network Connections
You may also get here through: Network and Sharing Center/Change adapter settings

See following picture for detailed explanation:
image

@nahdonivr
Copy link

I also encountered this issue, and fixed it, I think the root cause is: the document is unclear.
to solve this:
Please make sure you have selected the correct network
There are several networks in the list, but probably there is only one is enabled
You may check the status in: Control Panel\Network and Internet\Network Connections
You may also get here through: Network and Sharing Center/Change adapter settings

See following picture for detailed explanation:
image

Resolved my problem

@rustyx
Copy link

rustyx commented Jun 15, 2019

Do not connect the docker host directly to the external network. That's a major security hole since your docker containers will be directly accessible from outside.

Instead create an internal switch with a NAT.

New-VMSwitch -SwitchName docker -SwitchType Internal
Get-NetAdapter
New-NetIPAddress -IPAddress 172.16.0.1 -PrefixLength 16 -InterfaceAlias "vEthernet (docker)"
New-NetNat -Name nat1 -InternalIPInterfaceAddressPrefix 172.16.0.0/16

Since Hyper-V comes with no DHCP server, install a free DHCP server, for example TFTPD64. Configure DHCP on interface 172.16.0.1 to issue IP addresses in the range 172.16.0.2 ... 172.16.0.99.

@ghost
Copy link

ghost commented Oct 1, 2019

I also encountered this issue, and fixed it, I think the root cause is: the document is unclear.
to solve this:
Please make sure you have selected the correct network
There are several networks in the list, but probably there is only one is enabled
You may check the status in: Control Panel\Network and Internet\Network Connections
You may also get here through: Network and Sharing Center/Change adapter settings

See following picture for detailed explanation:
image

Thanks. This was Helpful. My issue got fixed.
I was selecting an unplugged adapter.

@CodeGTDLearn
Copy link

I also encountered this issue, and fixed it, I think the root cause is: the document is unclear.
to solve this:
Please make sure you have selected the correct network
There are several networks in the list, but probably there is only one is enabled
You may check the status in: Control Panel\Network and Internet\Network Connections
You may also get here through: Network and Sharing Center/Change adapter settings

See following picture for detailed explanation:
image

Definetly, it solved my problem

@brunoazuma
Copy link

I also encountered this issue, and fixed it, I think the root cause is: the document is unclear.
to solve this:
Please make sure you have selected the correct network
There are several networks in the list, but probably there is only one is enabled
You may check the status in: Control Panel\Network and Internet\Network Connections
You may also get here through: Network and Sharing Center/Change adapter settings

See following picture for detailed explanation:
image

Logged in just to thank you, solved mine too.

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Jun 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants