2

My problem is that docker worked in my windows 10 up until yesterday after I re installed android studio to my computer. It keps on telling me that:

Hardware assisted virtualization and data execution protection must be enabled in the BIOS. See https://docs.docker.com/docker-for-windows/troubleshoot/#virtualization

And I don't seem to have hyper-v in my " Turn Windows features on or off " but in task manager it seems to be there. I followed the instruction on the link but it still doesn't work. I have tried to uninstall both docker and android studio. I'm at loss here nothing I have tried so far have changed anything.

Raspberry
  • 31
  • 3
  • PS C:\Users\desse> docker run hello-world docker: error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/containers/create: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running. – Raspberry Oct 02 '20 at 06:59
  • Does this answer your question? [Docker for Windows error: "Hardware assisted virtualization and data execution protection must be enabled in the BIOS"](https://stackoverflow.com/questions/39684974/docker-for-windows-error-hardware-assisted-virtualization-and-data-execution-p) – CherryDT Nov 02 '21 at 08:12

2 Answers2

1

Docker requires both hardware virtualization (configured in BIOS) and Hyper-V (configured in Windows) enabled on your machine.

You can check if hardware virtualization is enabled with the PowerShell command (gcim Win32_ComputerSystem).HypervisorPresent If false, you must enable hardware virtualization in your BIOS.

After verifying your BIOS settings, you can check if Hyper-V is enabled by running (Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online).State To enable Hyper-V, run Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V –All from an administrator PowerShell session.

If both features are enabled, there is likely an issue with your Docker installation. I would suggest completely removing Docker and subsequently reinstalling per Microsoft's recommendations.

pirateofebay
  • 930
  • 1
  • 10
  • 25
  • 2
    When I run the command about hardware virtualization it shows false. But when I go into BIOS setting the virtualization option is enabled. – Raspberry Oct 04 '20 at 19:38
1

What worked for me was to type the following command into cmd or PowerShell:

bcdedit /set hypervisorlaunchtype auto

Other possible solutions are described here: Docker for Windows error: "Hardware assisted virtualization and data execution protection must be enabled in the BIOS"

CherryDT
  • 25,571
  • 5
  • 49
  • 74
  • While this code may solve the question, [including an explanation](//meta.stackexchange.com/q/114762) of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. Please [edit] your answer to add explanations and give an indication of what limitations and assumptions apply. – Yunnosch Nov 02 '21 at 09:28