I ran into this issue while installing Docker and could not find any pre-written guides to fixing it. I thought this might be a good place to post it.
Docker will fail to start up and throw an error - list “Erroractionpreference” - HyperV failed to connect.
If that happens, open Hyper-V Manager. Click “connect to server”, then “local computer.” If you get an error, follow these steps:
-
Open “Window Security”
-
Open “App & Browser control”
-
Click “Exploit protection settings” at the bottom
-
Switch to “Program settings” tab
-
Locate “C:\WINDOWS\System32\vmcompute.exe” in the list and expand it
-
Click “Edit”
-
Scroll down to “Code flow guard (CFG)” and uncheck “Override system settings”
-
Start vmcompute from powershell -
net start vmcompute
Thanks to this post for outlining these steps.
I hope this helps somebody else out!