for-win icon indicating copy to clipboard operation
for-win copied to clipboard

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

Open dnbr2002 opened this issue 8 years ago • 10 comments

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 avatar Dec 03 '17 17:12 dnbr2002

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

image

Why is that?

dnbr2002 avatar Dec 03 '17 19:12 dnbr2002

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 avatar Dec 08 '17 21:12 dnbr2002

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.

dnbr2002 avatar Dec 17 '17 15:12 dnbr2002

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

timothy2005 avatar Jul 06 '18 10:07 timothy2005

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

nahdonivr avatar Jan 26 '19 12:01 nahdonivr

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.

rustyx avatar Jun 15 '19 16:06 rustyx

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.

ghost avatar Oct 01 '19 19:10 ghost

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

CodeGTDLearn avatar Jan 11 '20 23:01 CodeGTDLearn

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.

brunoazuma avatar May 11 '20 16:05 brunoazuma

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-robott avatar Jun 25 '20 03:06 docker-robott