Monday 24 June 2019

Hyper-V problems on Windows 10 - docker/kubernetes on windows troubleshot

I've run into problems with running docker/kubernetes on my company machine (full of extra policies and vpn). I wanted to persist some of the things which helped me to go through it. I've found some articles in the network but still it took me many hours before I've manage to fix those - might save someone some time.

These are the main messages tormenting me before I've found solution:


Service 'Hyper-V Host Compute Service (vmcompute)' cannot be started due to the following error: Cannot start service vmcompute on computer '.'
Virtual Machine Management service failed to start.
An error occurred while attempting to connect to server "MY-PC-NAME". Check that the Virtual Machine service is running and that you are authorized to connect to the server. Hyper-V encountered an error trying to access an object on computer 'MY-PC-NAME' because the object was not found. The object might have been deleted. Verify that the Virtual Machine Management service on the computer is running.
... + others
Last but my favorite ;)
Error Not Found 
Let me try to point out the main checkpoints you should check on your way to greatness:
a) BIOS (if you are lucky enough to have access to it ;) ) - you should be having option for Hyper-V enabled
b) HYPER-V feature - Control Panel -> Programs and Features -> Turn Windows features on or off -select checkbox-> Hyper-V (install everything in that leaf)
c) SERVICES - run powershell and execute to have a look if everything is running smoothly (for me it was not - I've looked for log events and found that services were failing)
Get-Service "Hyper-V Virtual Machine Management"
Get-Service "Hyper-V Host Compute Service"
d) Windows Security -> App & browser control -scroll down-> Exploit protection settings -> Program settings -search from bottom for  C:\Windows\System32\vmcompute.exe-> Right Click - Edit -> Control flow guard (CFG) -uncheck-> Override system settings
e) restart windows / services
f) SERVICES - run powershell and double check if services are ok now (you might need to change autostart on some of them - run services.msc for that)
Get-Service "Hyper-V Virtual Machine Management"
Get-Service "Hyper-V Host Compute Service"
If you reached to a place where Hyper-V is working you can go with installation of Docker which from here is rather straight forward ;) There in newer version there is also Kubernetes which if enabled started without problems.