TAMIM HAIDER
TAMIM HAIDER

Reputation: 719

Docker daemon is not running

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

Upvotes: 36

Views: 306419

Answers (19)

SamWest
SamWest

Reputation: 131

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.

Upvotes: 0

favs
favs

Reputation: 21

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.

Upvotes: 0

ganesh parajuli
ganesh parajuli

Reputation: 167

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

Upvotes: 1

Eternal21
Eternal21

Reputation: 4664

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

Upvotes: 10

Harry Mate
Harry Mate

Reputation: 13

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.

Upvotes: 0

Imran Hussain
Imran Hussain

Reputation: 160

Two things:

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

and see the trick.

Upvotes: 1

Goyal Vicky
Goyal Vicky

Reputation: 1299

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

Upvotes: 6

Anonymous
Anonymous

Reputation: 109

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.

Upvotes: 9

Franco Canova
Franco Canova

Reputation: 71

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!

Upvotes: 3

Tahera Firdose
Tahera Firdose

Reputation: 181

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

Upvotes: 1

Muhammad Numan
Muhammad Numan

Reputation: 249

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

Upvotes: 1

Shyam Joshi
Shyam Joshi

Reputation: 21

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

Upvotes: -2

Venkat07
Venkat07

Reputation: 11

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

Upvotes: 0

Lukisi Motsoeneng
Lukisi Motsoeneng

Reputation: 31

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

Upvotes: 3

rahul
rahul

Reputation: 73

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.

Upvotes: 1

mGm
mGm

Reputation: 262

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.

Upvotes: 1

Utopia
Utopia

Reputation: 661

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.

Upvotes: 29

sunil rana
sunil rana

Reputation: 43

You can use cmd in centos 7

systemctl restart docker

Upvotes: -2

error404
error404

Reputation: 2823

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

Upvotes: 16

Related Questions