Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Waiting for host to start... (hyperv) #4328

Closed
hinell opened this issue Dec 7, 2017 · 16 comments
Closed

Waiting for host to start... (hyperv) #4328

hinell opened this issue Dec 7, 2017 · 16 comments

Comments

@hinell
Copy link

hinell commented Dec 7, 2017

I left this issue open only for a while and will keep several days before closing if nobody gonna report again. I'll reopen it once the problem rise again. If you see the issue is closed feel free to leave your questions below anyway.

SOLVED: At first try to stop using --hyperv-memory cause it is fails to start up your vm even if it is adjusted via hyper-v-manager. Also, you should specify --hyperv-virtual-switch explicitly to allow docker to connect properly. If it still doesn't work then try to remove virtual switch bridge manually via windows network adapters settings and create it once again by using hyper-v manager.
See also another solution below


Hangs on when I'm creating new virtual machine.
I followed several similar issues for virtualbox like #3826 but with no luck.

Setup

windows 10 x64
boot2docker - v17.11.0-ce
docker - 17.11.0-ce

Virtual switch is enabled via Hyper-V manager as described here

Steps to reproduce

1 Install docker & Enable hyper-v feature in windows features
2 Enable Virtual Switch
3 $ docker-machine create -d hyperv --hyperv-memory 512 vm1
4 Hangs forever

screenshot_3

I also tried to use --debug flag with the same command and got this (clickable) output:

Docker Machine Version:  0.13.0, build 9ba6da9
Found binary path at C:\Program Files\Docker\Docker\Resources\bin\docker-machine.exe
Launching plugin server for driver hyperv
Plugin server listening at address 127.0.0.1:56251
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(flag-lookup) Calling .GetMachineName
(flag-lookup) Calling .DriverName
(flag-lookup) Calling .GetCreateFlags
Found binary path at C:\Program Files\Docker\Docker\Resources\bin\docker-machine.exe
Launching plugin server for driver hyperv
Plugin server listening at address 127.0.0.1:56255
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(vm1) Calling .GetMachineName
(vm1) Calling .DriverName
(vm1) Calling .GetCreateFlags
(vm1) Calling .SetConfigFromFlags
(vm1) Calling .PreCreateCheck
(vm1) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @(Get-Command Get-VM).ModuleName
(vm1) DBG | [stdout =====>] : Hyper-V
(vm1) DBG |
(vm1) DBG | [stderr =====>] :
(vm1) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole("Hyper-V Administrators")
(vm1) DBG | [stdout =====>] : False
(vm1) DBG |
(vm1) DBG | [stderr =====>] :
(vm1) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
(vm1) DBG | [stdout =====>] : True
(vm1) DBG |
(vm1) DBG | [stderr =====>] :
(vm1) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive (Get-VMSwitch).Name
(vm1) DBG | [stdout =====>] : DockerNAT
(vm1) DBG | DVS
(vm1) DBG |
(vm1) DBG | [stderr =====>] :
(vm1) DBG | local Boot2Docker ISO version:  v17.11.0-ce
(vm1) Calling .GetConfigRaw
(vm1) Calling .Create
(vm1) DBG | local Boot2Docker ISO version:  v17.11.0-ce
(vm1) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive (Get-VMSwitch).Name
(vm1) DBG | [stdout =====>] : DockerNAT
(vm1) DBG | DVS
(vm1) DBG |
(vm1) DBG | [stderr =====>] :
(vm1) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
(vm1) DBG | [stdout =====>] : True
(vm1) DBG |
(vm1) DBG | [stderr =====>] :
(vm1) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive New-VHD -Path 'C:\Users\Alex\.docker\machine\machines\vm1\fixed.vhd' -SizeBytes 10MB -Fixed
(vm1) DBG | [stdout =====>] :
(vm1) DBG |
(vm1) DBG | ComputerName            : RHEA
(vm1) DBG | Path                    : C:\Users\Alex\.docker\machine\machines\vm1\fixed.vhd
(vm1) DBG | VhdFormat               : VHD
(vm1) DBG | VhdType                 : Fixed
(vm1) DBG | FileSize                : 10486272
(vm1) DBG | Size                    : 10485760
(vm1) DBG | MinimumSize             :
(vm1) DBG | LogicalSectorSize       : 512
(vm1) DBG | PhysicalSectorSize      : 512
(vm1) DBG | BlockSize               : 0
(vm1) DBG | ParentPath              :
(vm1) DBG | DiskIdentifier          : 03143A6A-646C-4DDC-AEBA-469A41EC764C
(vm1) DBG | FragmentationPercentage : 0
(vm1) DBG | Alignment               : 1
(vm1) DBG | Attached                : False
(vm1) DBG | DiskNumber              :
(vm1) DBG | Number                  :
(vm1) DBG |
(vm1) DBG |
(vm1) DBG |
(vm1) DBG |
(vm1) DBG | [stderr =====>] :
(vm1) DBG | Writing magic tar header
(vm1) DBG | Writing SSH key tar header
(vm1) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Convert-VHD -Path 'C:\Users\Alex\.docker\machine\machines\vm1\fixed.vhd' -DestinationPath 'C:\Users\Alex\.docker\machine\machines\vm1\disk.vhd' -VHDType Dynamic -DeleteSource
(vm1) DBG | [stdout =====>] :
(vm1) DBG | [stderr =====>] :
(vm1) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Resize-VHD -Path 'C:\Users\Alex\.docker\machine\machines\vm1\disk.vhd' -SizeBytes 20000MB
(vm1) DBG | [stdout =====>] :
(vm1) DBG | [stderr =====>] :
(vm1) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive New-VM vm1 -Path 'C:\Users\Alex\.docker\machine\machines\vm1' -SwitchName 'DockerNAT' -MemoryStartupBytes 512MB
(vm1) DBG | [stdout =====>] :
(vm1) DBG | Name State CPUUsage(%) MemoryAssigned(M) Uptime   Status             Version
(vm1) DBG | ---- ----- ----------- ----------------- ------   ------             -------
(vm1) DBG | vm1  Off   0           0                 00:00:00 Operating normally 8.0
(vm1) DBG |
(vm1) DBG |
(vm1) DBG |
(vm1) DBG | [stderr =====>] :
(vm1) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Set-VMDvdDrive -VMName vm1 -Path 'C:\Users\Alex\.docker\machine\machines\vm1\boot2docker.iso'
(vm1) DBG | [stdout =====>] :
(vm1) DBG | [stderr =====>] :
(vm1) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Add-VMHardDiskDrive -VMName vm1 -Path 'C:\Users\Alex\.docker\machine\machines\vm1\disk.vhd'
(vm1) DBG | [stdout =====>] :
(vm1) DBG | [stderr =====>] :
(vm1) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Start-VM vm1
(vm1) DBG | [stdout =====>] :
(vm1) DBG | [stderr =====>] :
(vm1) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive ( Get-VM vm1 ).state
(vm1) DBG | [stdout =====>] : Running
(vm1) DBG |
(vm1) DBG | [stderr =====>] :
(vm1) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive (( Get-VM vm1 ).networkadapters[0]).ipaddresses[0]
(vm1) DBG | [stdout =====>] :
(vm1) DBG | [stderr =====>] :
(vm1) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive ( Get-VM vm1 ).state
(vm1) DBG | [stdout =====>] : Running
I also tried to remove user/.docker/machine/cache/boot2docker.iso and create vm again but didn't help. The machine hangs anyway.
@hinell hinell closed this as completed Dec 13, 2017
@knilecrack
Copy link

I have the similar issue, except my machine starts and it never gets an IP address, even though I followed everything from docs.

docker --version: Docker version 17.12.0-ce-rc3, build 80c8033
docker-machine --version: docker-machine.exe version 0.13.0, build 9ba6da9

This is on edge, same thing happens on stable.

Although, I noticed I can't run windows containers for some reason, so it looks like something is wrong with my current setup.
win 10 build: 17025

docker-machine --debug -d "hyperv" --hyperv-virtual-switch "BridgedConnection" worker3

Found binary path at C:\Program Files\Docker\Docker\Resources\bin\docker-machine.exe
Launching plugin server for driver hyperv
Plugin server listening at address 127.0.0.1:49302
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(flag-lookup) Calling .GetMachineName
(flag-lookup) Calling .DriverName
(flag-lookup) Calling .GetCreateFlags
Found binary path at C:\Program Files\Docker\Docker\Resources\bin\docker-machine.exe
Launching plugin server for driver hyperv
Plugin server listening at address 127.0.0.1:49306
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(worker3) Calling .GetMachineName
(worker3) Calling .DriverName
(worker3) Calling .GetCreateFlags
(worker3) Calling .SetConfigFromFlags
Running pre-create checks...
(worker3) Calling .PreCreateCheck
(worker3) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @(Get-Command Get-VM).ModuleName
(worker3) DBG | [stdout =====>] : Hyper-V
(worker3) DBG |
(worker3) DBG | [stderr =====>] :
(worker3) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole("Hyper-V Administrators")
(worker3) DBG | [stdout =====>] : False
(worker3) DBG |
(worker3) DBG | [stderr =====>] :
(worker3) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
(worker3) DBG | [stdout =====>] : True
(worker3) DBG |
(worker3) DBG | [stderr =====>] :
(worker3) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive (Get-VMSwitch).Name
(worker3) DBG | [stdout =====>] : nat
(worker3) DBG | Default Switch
(worker3) DBG | BridgedSwitch
(worker3) DBG |
(worker3) DBG | [stderr =====>] :
(worker3) DBG | local Boot2Docker ISO version:  v17.09.1-ce
(worker3) Calling .GetConfigRaw
Creating machine...
(worker3) Calling .Create
(worker3) DBG | local Boot2Docker ISO version:  v17.09.1-ce
(worker3) Copying C:\Users\McMau\.docker\machine\cache\boot2docker.iso to C:\Users\McMau\.docker\machine\machines\worker3\boot2docker.iso...
(worker3) Creating SSH key...
(worker3) Creating VM...
(worker3) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive (Get-VMSwitch).Name
(worker3) DBG | [stdout =====>] : nat
(worker3) Using switch "BridgedSwitch"
(worker3) DBG | Default Switch
(worker3) DBG | BridgedSwitch
(worker3) DBG |
(worker3) DBG | [stderr =====>] :
(worker3) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principa
l.WindowsBuiltInRole] "Administrator")
(worker3) DBG | [stdout =====>] : True
(worker3) DBG |
(worker3) DBG | [stderr =====>] :
(worker3) Creating VHD
(worker3) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive New-VHD -Path 'C:\Users\McMau\.docker\machine\machines\worker3\fixed.vhd' -SizeBytes 10MB -Fixed
(worker3) DBG | [stdout =====>] :
(worker3) DBG |
(worker3) DBG | ComputerName            : BIZNISPC
(worker3) DBG | Path                    : C:\Users\McMau\.docker\machine\machines\worker3\fixed.vhd
(worker3) DBG | VhdFormat               : VHD
(worker3) DBG | VhdType                 : Fixed
(worker3) DBG | FileSize                : 10486272
(worker3) DBG | Size                    : 10485760
(worker3) DBG | MinimumSize             :
(worker3) DBG | LogicalSectorSize       : 512
(worker3) DBG | PhysicalSectorSize      : 512
(worker3) DBG | BlockSize               : 0
(worker3) DBG | ParentPath              :
(worker3) DBG | DiskIdentifier          : 54A43223-9A0E-4E76-B3AF-15AC85F64942
(worker3) DBG | FragmentationPercentage : 0
(worker3) DBG | Alignment               : 1
(worker3) DBG | Attached                : False
(worker3) DBG | DiskNumber              :
(worker3) DBG | IsPMEMCompatible        : False
(worker3) DBG | AddressAbstractionType  : None
(worker3) DBG | Number                  :
(worker3) DBG |
(worker3) DBG |
(worker3) DBG |
(worker3) DBG |
(worker3) DBG | [stderr =====>] :
(worker3) DBG | Writing magic tar header
(worker3) DBG | Writing SSH key tar header
(worker3) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Convert-VHD -Path 'C:\Users\McMau\.docker\machine\machines\worker3\fixed.vhd' -DestinationPath 'C:\Users\McMau\.docker\machine\machines\worker3\disk.vhd' -VHDType Dynamic -DeleteSource
(worker3) DBG | [stdout =====>] :
(worker3) DBG | [stderr =====>] :
(worker3) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Resize-VHD -Path 'C:\Users\McMau\.docker\machine\machines\worker3\disk.vhd' -SizeBytes 20000MB
(worker3) DBG | [stdout =====>] :
(worker3) DBG | [stderr =====>] :
(worker3) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive New-VM worker3 -Path 'C:\Users\McMau\.docker\machine\machines\worker3' -SwitchName 'BridgedSwitch' -MemoryStartupBytes 1024MB
(worker3) DBG | [stdout =====>] :
(worker3) DBG | Name    State CPUUsage(%) MemoryAssigned(M) Uptime   Status             Version
(worker3) DBG | ----    ----- ----------- ----------------- ------   ------             -------
(worker3) DBG | worker3 Off   0           0                 00:00:00 Operating normally 8.2
(worker3) DBG |
(worker3) DBG |
(worker3) DBG |
(worker3) DBG | [stderr =====>] :
(worker3) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Set-VMDvdDrive -VMName worker3 -Path 'C:\Users\McMau\.docker\machine\machines\worker3\boot2docker.iso'
(worker3) DBG | [stdout =====>] :
(worker3) DBG | [stderr =====>] :
(worker3) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Add-VMHardDiskDrive -VMName worker3 -Path 'C:\Users\McMau\.docker\machine\machines\worker3\disk.vhd'
(worker3) DBG | [stdout =====>] :
(worker3) Starting VM...
(worker3) DBG | [stderr =====>] :
(worker3) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Start-VM worker3
(worker3) DBG | [stdout =====>] :
(worker3) DBG | [stderr =====>] :
(worker3) Waiting for host to start...
(worker3) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive ( Get-VM worker3 ).state
(worker3) DBG | [stdout =====>] : Running
(worker3) DBG |
(worker3) DBG | [stderr =====>] :
(worker3) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive (( Get-VM worker3 ).networkadapters[0]).ipaddresses[0]
(worker3) DBG | [stdout =====>] :
(worker3) DBG | [stderr =====>] :
(worker3) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive ( Get-VM worker3 ).state
(worker3) DBG | [stdout =====>] : Running
(worker3) DBG |

@hinell hinell reopened this Dec 19, 2017
@hinell
Copy link
Author

hinell commented Dec 19, 2017

@knilecrack
What does sandbox in Virtual-V manager shows? Make & share screenshot please.
Seems like vm can't connect to the network cause have no ip assigned or vm just doesn't start properly.

@knilecrack
Copy link

Did you mean this ? https://1drv.ms/u/s!AtmVXevYpYur6j6WHvexC6ShiqkO
So basically I got it to work now, after windows updated to 17063 I completely uninstalled docker everything that I could find (from programdata and from appdata) and reinstalled hyperv using dism.
Only problem now is that it needs like 5-10 minutes to get an IP.
Is there anyway to troubleshoot these connection problems more deeply?

@hinell
Copy link
Author

hinell commented Dec 23, 2017

Is there anyway to troubleshoot these connection problems more deeply?

Don't know really. ¯_(ツ)_/¯

I'll close the issue until the problem arises again.

@hinell hinell closed this as completed Dec 24, 2017
@innovaweb-dev
Copy link

innovaweb-dev commented Dec 31, 2017

Hi everybody and happy new year.
I am beginner in Docker and I have same problem that you.
I would like to follow the official tutorial of Docker Get Started, Part 4: Swarms

I followed correctly instructions of this page Microsoft Hyper-V
But my PowerShell stay blocked on Waiting for host to start...
docker-machine create -d hyperv --hyperv-virtual-switch "myswitch" myvm1

image
Sorry, it's in french

image

My setup

Windows:
Windows 10 PRO
Version: 1709
OS: 16299.125 

Client:
 Version:      17.09.1-ce
 API version:  1.32
 Go version:   go1.8.3
 Git commit:   19e2cf6
 Built:        Thu Dec  7 22:22:26 2017
 OS/Arch:      windows/amd64

Server:
 Version:      17.09.1-ce
 API version:  1.32 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   19e2cf6
 Built:        Thu Dec  7 22:28:28 2017
 OS/Arch:      linux/amd64
 Experimental: true

docker-machine.exe version 0.13.0, build 9ba6da9

What can I do to resolve this problem ?
Thanks and happy new year again.

@hinell hinell reopened this Jan 14, 2018
@hinell
Copy link
Author

hinell commented Jan 14, 2018

@rifton007
Does the problem still persist?
It seems like that the VM started properly but haven't connected to the network.

@knilecrack
Copy link

start with --debug option and paste output.

@knilecrack
Copy link

knilecrack commented Jan 21, 2018

hey, if you still have issue, try setting IP address manually in VM. 1st get subnet of the switch by right-clicking on adapter that you are trying to use for VM, choose status and then details and you will see a network and subnet of the switch. Then you can try to assign an IP from that subnet on the machine.

Connect to a VM from hyperv, and then just type: ifconfig eth0 172.27.240.10 netmask 255.255.240.0 (in my case)

let me know if that worked for you, you can check by docker-machine ls

@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

@hinell
Copy link
Author

hinell commented Jul 7, 2018

@timothy2005 Thanks for you efforts. 👍 Added link to your solution to the top.

@timothy2005
Copy link

@hinell Thanks a lot!

@amanagr
Copy link

amanagr commented Aug 20, 2018

I am facing the same problem as @rifton007 #4328 (comment)

SOLVED BY @timothy2005's #4328 (comment). Thanks..

@moviewang
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

It worked for me! tks

@hinell hinell closed this as completed Feb 20, 2019
@tahsear
Copy link

tahsear commented Jul 17, 2019

I faced the same issue. retried from powershell window in admin mode, first vm took around 10 minutes while appeared to be stuck at Starting Vm step but eventually completed the task. second vm was created much faster.

@Fsud
Copy link

Fsud commented Aug 9, 2019

solve this by NOT add -hyperv-memory!At fitst i set this to 512, but when i remove this, it works.

@roeliman
Copy link

my way out, thanks @moviewang

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants