31

Newbie in this area. I have installed the new version of Docker in my windows PC. I am using windows 10 Pro. I have tried the very basic docker command but it is not working. I have also run the docker as administrator. Getting the below error always

docker: error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.39/containers/create: open //./pipe/docker_engine: Zugriff verweigert 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.

enter image description here

vahdet
  • 6,357
  • 9
  • 51
  • 106
TAMIM HAIDER
  • 641
  • 1
  • 10
  • 19

19 Answers19

24

Doing an combination of following two things might help :

- Exit docker from tray (lower right hand of the windows desktop)
- Relaunch it as administrator (Start Menu --> Type "Docker" --> Right Click the icon --> "Run as Administrator"

Please see if you still get the error.

Utopia
  • 591
  • 1
  • 8
  • 14
  • Right clicking on Tray icon doesn't show 'Exit' menu. Need to go to the Task Manager and kill Docker Desktop to exit it from Tray – Sagar S. May 27 '21 at 10:54
  • First I checked the Docker serivce in Services.msc is running. Then I had to kill the Docker Desktop Service process from Task manager, then relaunch Docker Desktop as administrator. It took some minutes to launch, but it is working now. My Docker version is 20.10.16 running on Windows 10 pro x64. It seems it doesn't get admin privileges when starting with the OS. – Broken_Window Jun 28 '22 at 14:41
13

Seems to be related to the below issue:

I had the same issue - I was able to resolve the issue by running power shell with Admin privs. I validated this was the same behavior for running the commands via elevated cmd prompt. It also enabled docker run hello-world command which was returning the error message ...Access is denied. 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.

here

error404
  • 2,684
  • 2
  • 13
  • 21
  • 1
    with reset > reset a factory defaults it works properly now. – TAMIM HAIDER May 07 '19 at 07:48
  • Nothing was working for me so I uninstalled and installed again. That's when I got the error saying "sever "service needs to be enabled. Opened services with admin privileges and started it. Now docker is working fine. – Apoorv Patne May 26 '21 at 13:49
8

I did the following :

  1. In windows you can go to the show hidden icon in the taskbar, hover your cursor on the docker icon and right click then a drop down menu will be shown and from that click restart.

  2. press windows key + R

    %appdata%\Docker

    delete all the the files in the folder

  3. killed the docker process in task bar.

  4. try to open docker gui again.

  5. check out this link if none of the above works, check out this link : Docker cannot start on Windows

check link : https://bobcares.com/blog/docker-error-response-from-daemon-i-o-timeout/

  1. if nothing is work try to uninstall and reinstall the docker.
Anonymous
  • 99
  • 1
  • 3
6

What worked for me:: First clicking on troubleshoot and then doing reset to factory defaults. enter image description here

Warning: the existing containers will be gone

Goyal Vicky
  • 1,249
  • 16
  • 16
4

I got this error because my Docker Desktop was not running. Resolved by starting Docker Desktop.

Eternal21
  • 4,190
  • 2
  • 48
  • 63
2

If you don't have any WSL installed :

  • Ensure that the Hyper-V feature enabled, you can do this by searching "Turn Windows features On or Off".
  • Using Docker desktop, disable the option to "Use the WSL 2 based engine"(which is recommended, so only use if you don't have any WSL installed).Docker desktop settings
  • This helped me a lot! I forgot I had set up docker for working with linux subsystem, this messed up the docker installation for windows itself. Disabling the WSL2 based engine option did the trick for me. – Andrea Apr 21 '21 at 09:09
1

In case, Docker Deamon is still not running when using it for the first time, this video might help. I solved this issue by downloading WSL 2 file and installing it manually on my windows machine.

mGm
  • 264
  • 2
  • 12
1

I also have the same error while i try to run docker, the problem in my case is i never install WSL2 linux kernal in my window. After installation my docker running well. follow these steps to make your docker running well in windows. First uninstall your current docker and make sure your window have the following features:

  1. Hyper-V installed and working
  2. Virtualization enabled in the BIOS
  3. Hypervisor enabled at Windows startup

This link guide you to complete above steps

Now open this link to download the WSL 2 linux kernal pakage

After the installation of WSL 2 is done. Install your docker again, follow the instructions and it will work perfectly.

rahul
  • 53
  • 4
1

By simply opening the Docker on the desktop just and restarting the Docker, you can easily resolve it. Open the troubleshoot of Docker and restart the docker as shown in this image. Troubleshooting docker

Muhammad Waqas Dilawar
  • 1,844
  • 1
  • 23
  • 34
Muhammad Numan
  • 237
  • 4
  • 20
1

I faced the same issue and what worked for me is

Navigate to the below link, download and install the Linux kernel update package (step4)

https://learn.microsoft.com/en-us/windows/wsl/install-win10#step-4---download-the-linux-kernel-update-package

Make sure to restart your system after installation

Tahera Firdose
  • 161
  • 1
  • 3
1

What worked for me:

Go to Docker Desktop > Troubleshoot (the bug icon) > Reset to factory defaults. All containers need to be pulled again from registry but was up again in no time.

Hope this works for someone!

1

Two things:

  1. Run the docker as administrator
  2. Run Powershell as administrator

and see the trick.

1

Step 1 - Enable the Windows Subsystem for Linux Open PowerShell as Administrator (Start menu > PowerShell > right-click > Run as Administrator) and enter this command:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Step 2 - Enable Virtual Machine feature Open PowerShell as Administrator and run:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Step 3 - Download the Linux kernel update package WSL2 Linux kernel update package for x64 machine Run the update package downloaded in the previous step

Step 4 Open PowerShell and run this command to set WSL 2 as the default version when installing a new Linux distribution:

wsl --set-default-version 2

Step 5 Restart you PC

note - Please enable Virtualization Technology from the boot menu its important to check and verify: Go to taskmanager and click on the performance and see Virtualization enable or not.

enter image description here


Open Powershell and run bellow cmd:

cd "C:\Program Files\Docker\Docker" ./DockerCli.exe -SwitchDaemon

0

After installation of Docker connect to PowerShell as admin and run below command.
It will start the Docker service.
Step 1> cd "C:\Program Files\Docker\Docker"
Step 2> ./DockerCli.exe -SwitchDaemon

greybeard
  • 2,249
  • 8
  • 30
  • 66
0

This thread was one of the first that I found, so wanted to compile some of the solutions I've found for various issues. I am using Windows 11 & a first time docker install.

Issue 1: Docker desktop was 'stopped' and whenever I tried to run a package in the terminal I was getting a long message ending in: This error may also indicate that the docker daemon is not running.

Solution:

Follow the official steps on how to install WSL 2 at https://learn.microsoft.com/en-us/windows/wsl/install

Open PowerShell and run command: wsl --update

Uninstall Docker.

Delete temporary data:

C:\Users<USER>\AppData\Roaming\Docker

C:\Users\ProgramData\Docker

C:\Users\ProgramData\DockerDesktop

Reinstall Docker, ensure wsl box is ticked during install.

Restart computer.

Run Docker as administrator.

Run PowerShell as administrator.

Run the following command:

& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon

If this doesn't work, you may need to run the above command one or two more times.

Issue 2: Docker desktop settings check box 'Use the WSL 2 based engine (Windows Home can only run the WSL 2 backend)' was greyed out and unchecked.

Solution:

Open: C:\Users<USER>\AppData\Roaming\Docker\settings.json Change: "wslEngineEnabled": false to "wslEngineEnabled": true

Reinstall Docker & restart computer. (not sure if necessary.)

Run Docker as administrator.

Run PowerShell as administrator.

Run the following command:

& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon

If this doesn't work, you may need to run the above command one or two more times.

Harry Mate
  • 13
  • 3
0

i tried numerous ways to solve this but i noticed that when my docker is not working, the Ubuntu app for windows shouldn't work also. As such after digging through numerous errors, i found that hypervisor launch is not enabled in my boot configuration (Windows). You can check if it is set to on using the command

bcdedit /enum | findstr -i hypervisorlaunchtype

if it is set to off, set it to auto

bcdedit /set {current} hypervisorlaunchtype Auto

now, if the docker issue is still not resolved, you can try switching the containers to ubuntu if it is not set yet, hope this helps.

favs
  • 21
  • 1
0

I spent all day troubleshooting this exact issue (after a Windows 11 update, which a few other threads suggested might be the cause), and tried most things suggested in this thread.

What eventually worked was completely removing docker and WSL (guide here), rebooting, and reinstalling WSL then docker again.

Hope this helps someone else.

SamWest
  • 132
  • 1
  • 8
-2

You can use cmd in centos 7

systemctl restart docker

sunil rana
  • 35
  • 5
  • This response would not apply to Windows 10 Pro, as the original post mentions is being used. –  Aug 15 '20 at 23:11
-2

Yes, suggested solution worked for me.

After installation of Docker connect to PowerShell as admin and run below command. It will start the Docker service.

C:\Program Files\Docker\Docker/DockerCli.exe -SwitchDaemon

  • Consider _upvoting_ the answer that worked for you rather than reposting it to reduce unnecessary noise. – ggorlen Apr 23 '23 at 21:30