Jim
Jim

Reputation: 16002

Docker cannot start on Windows

Executing docker version command on Windows returns the following results:

C:\Projects> docker version
Client:
 Version:      1.13.0-dev
 API version:  1.25
 Go version:   go1.7.3
 Git commit:   d8d3314
 Built:        Tue Nov  1 03:05:34 2016
 OS/Arch:      windows/amd64
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.25/version: 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.

Running the diagnostics produces the following:

C:\Projects> wget https://github.com/Microsoft/Virtualization- 
Documentation/raw/master/windows-server-container-tools/Debug- 
ContainerHost/Debug-ContainerHost.ps1 -UseBasicParsin | iex

Checking for common problems
Describing Windows Version and Prerequisites
 [+] Is Windows 10 Anniversary Update or Windows Server 2016 608ms
 [+] Has KB3192366, KB3194496, or later installed if running Windows build 14393 141ms
 [+] Is not a build with blocking issues 29ms
Describing Docker is installed
 [-] A Docker service is installed - 'Docker' or 'com.Docker.Service'  134ms
   Expected: value to not be empty
   27:         $services | Should Not BeNullOrEmpty
   at <ScriptBlock>, <No file>: line 27
 [+] Service is running 127ms
 [+] Docker.exe is in path 2.14s
Describing User has permissions to use Docker daemon
 [+] docker.exe should not return access denied 42ms
Describing Windows container settings are correct
 [-] Do not have DisableVSmbOplock set to 1 53ms
   Expected: {0}
   But was:  {1}
   66:              $regvalue.VSmbDisableOplocks | Should Be 0
   at <ScriptBlock>, <No file>: line 66
 [+] Do not have zz values set 42ms
Describing The right container base images are installed
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.25/images/json: 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.
 [-] At least one of 'microsoft/windowsservercore' or 'microsoft/nanoserver' should be installed 129ms
   ValidationMetadataException: The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
   ParameterBindingValidationException: Cannot validate argument on parameter 'Property'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
   at <ScriptBlock>, <No file>: line 90
Describing Container network is created
 [-] Error occurred in Describe block 1.08s
   RuntimeException: Cannot index into a null array.
   at <ScriptBlock>, <No file>: line 119
Showing output from: docker info

Showing output from: docker version
Client:
 Version:      1.13.0-dev
 API version:  1.25
 Go version:   go1.7.3
 Git commit:   d8d3314
 Built:        Tue Nov  1 03:05:34 2016
 OS/Arch:      windows/amd64

Showing output from: docker network ls

Warnings & errors from the last 24 hours
Logs saved to C:\Projects\logs_20161107-084122.csv
C:\Projects>

Upvotes: 495

Views: 1283657

Answers (30)

Adam Nofsinger
Adam Nofsinger

Reputation: 4174

TL;DR: Installed with a UAC prompt where you logged in as a different user with admin privilege on local PC? Then you need to add your normal, low-privilege user to docker-users group and log out and back in that user.

For me, none of these answers was quite on the mark or simple enough. I work at a business where, like many businesses (I hope), I have a privileged account with local admin access on my PC, but I run my day-to-day logged in as a low-privilege user that is not an admin on any PC.

So when I installed Docker Desktop, it prompted UAC and I elevated providing my admin user credentials. But after install, I could only get Docker Desktop to run by running as Admin, and all the other fixes listed here seemed to just produce error messages. But I found a helpful answer elsewhere that pointed me to this information on how Docker Desktop and Windows Permissions are implemented: https://docs.docker.com/desktop/setup/install/windows-permission-requirements/ and I realized that the problem is I installed it with my "-a" admin account, and that account got added to the docker-users group, but my normal account I log in with needed to be added to docker-users as well - and then a log out and log back in was needed after that (cached group membership probably).

Upvotes: 0

ravinder reddy
ravinder reddy

Reputation: 316

one of the reason could memory issues. i recently faced this and i have to mouth the data onto external hard disk to have enough memory to container.

this error definitely mean docker is corrupted and needs to be reinstalled. and make sure users/{userName}/appData/Local/Docker folder is removed completely

Upvotes: 0

Karobwe
Karobwe

Reputation: 526

Delete the folder under %appdata%\Docker as indicated in Github issues

For quick access press Win+R, paste %appdata%\Docker then Enter, it should open a folder located in AppData\Roaming\Docker (e.g. C:\Users\YourUsername\AppData\Roaming\Docker)

Upvotes: 5

Prasanth Louis
Prasanth Louis

Reputation: 5036

For me the issue was virtualization was not enabled.

On windows 10: Go to task manager -> Performance -> CPU and you should see as section as "Virtualization : Enabled"

If you do not see this option, it means that virtualization has not been enabled.

Another interesting thing to note is you must have Hyper V enabled. However as I was using parallels desktop, I had to enabled to "Nested Virtualization" for Hyper V to be "truly enabled". So if your windows is a VM, check out the settings for Parallels (or whatever you're using) that nested virtualization is enabled.

Upvotes: 5

Banupriya
Banupriya

Reputation: 195

For me docker was running fine.After the update i was not able to connect to it though it was running.

Tried all of these (DOCKER_HOST environment variable was set, proxies were added, deamon started without TLS, restart from docker destop app, restart the system, reinstall ) nothing worked for me.

when i clicked

quit docker desktop from docker desktop app's settings

and then started docker desktop app again with admin privilege. it worked like charm.

Upvotes: 0

Hanamant Jadhav
Hanamant Jadhav

Reputation: 657

If you see docker desktop is STOPPED or Not Running screen at left side bottom, then do following

  1. Open PowerShell with – Run as Administrator
  2. Close Docker Desktop if it is open
  3. Execute the following command on PowerShell “& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon”
  4. Open Docker Desktop, it will get started.

Upvotes: 33

Pradeep Sanjeewa
Pradeep Sanjeewa

Reputation: 2212

Starting the docker daemon resolved the issue. Just search for docker by pressing the Windows key and clicking on "Docker Desktop". The daemon should be running in a minute. enter image description here

After starting up Docker Desktop, make sure the docker daemon status in the bottom left is green and shows RUNNING when you hover over it.

Upvotes: 160

sergey sahon
sergey sahon

Reputation: 93

I had issue with windows docker service rights, just switched from 'Network Service' to 'Local System' and it started working

Upvotes: 0

Vic Stalkeur
Vic Stalkeur

Reputation: 123

I installed Docker from scratch and encountered this problem. It was resolved by installing WSL.

wsl --install

Upvotes: 1

lordvoldemort
lordvoldemort

Reputation: 85

I have faced such a problem a couple of times, but every time it's because I did not start the docker. To solve this issue, Just open your docker and wait until it finishes starting.

Upvotes: -3

Suresh
Suresh

Reputation: 1601

Somehow my docker desktop couldn't start in the first attempt post installation and system restart, so i killed the docker process in the task manager and opened the docker desktop again, viola it started fine. Able to run projects from cmd prompt (docker run -d -p <project_name>), able to see my container images as well in docker desktop.

enter image description here

Upvotes: 3

svonjoi
svonjoi

Reputation: 99

My case was that I ran docker commands in WSL shell and were still able to do this, while in git-bash (or another windows based shell) i was facing this error.

The solution for me was this answer but then restarting windows

Upvotes: 1

Emirhan Selim Uzun
Emirhan Selim Uzun

Reputation: 1090

If you are getting this pop-up:

enter image description here

Click the link in pop-up. And dowloand this 'WSL2 Linux kernel update package for x64 machines':

enter image description here

Once you downloaded it. Go through the installation. Then restart Docker. It will work.

Upvotes: 0

ivangretsky
ivangretsky

Reputation: 318

I had the same issue in the terminal right after installation of Docker Desktop 4.7.1 running with WSL 2 backend. The tray whale icon was not showing either.

In my case the problem was that I already had a WSL distribution (Ubuntu) installed before and it has been the default. Docker Desktop with WSL 2 backend installs its own distribution called docker-desktop. And it has to be the default one (at least if not configured elsewhere).

So I had to run this command in PowerShell: wsl --setdefault docker-desktop and restart docker services. Found the solution here.

Upvotes: 8

Matt Ghafouri
Matt Ghafouri

Reputation: 1577

You can also use Self-diagnose tool

Docker Desktop contains a self-diagnose tool which helps you to identify some common problems. Before you run the self-diagnose tool, locate com.docker.diagnose.exe. This is usually installed in C:\Program Files\Docker\Docker\resources\com.docker.diagnose.exe.

To run the self-diagnose tool in Powershell:

& "C:\Program Files\Docker\Docker\resources\com.docker.diagnose.exe" check

The tool runs a suite of checks and displays PASS or FAIL next to each check. If there are any failures, it highlights the most relevant at the end.

Then run This command

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

Upvotes: 4

veben
veben

Reputation: 22262

The error is related to that part:

In the default daemon configuration on Windows, the docker client must be run elevated to connect

  • First, verify that Docker Desktop application is running. If not, launch it: that will run the docker daemon (just wait few minutes).

  • Then, if the error still persist, you can try to switch Docker daemon type, as explained below:

With Powershell:

  1. Open Powershell as administrator
  2. Launch command: & 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon

OR, with cmd:

  1. Open cmd as administrator
  2. Launch command: "C:\Program Files\Docker\Docker\DockerCli.exe" -SwitchDaemon

Upvotes: 713

Madinabonu Alisherova
Madinabonu Alisherova

Reputation: 61

First, I downloaded docker for windows 10, OS Built 19042 and version 20H2, as shown in this video, but my docker was at the beginning stage. I run the docker with the command provided, but I got such an error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version: open //./pipe/docker_engine: The system cannot find the file

Then, these solutions worked for me to start the docker:

  1. Open Powershell as administrator & run this command: 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon

OR

  1. Open cmd as administrator & run this command: "C:\Program Files\Docker\Docker\DockerCli.exe" -SwitchDaemon

enter image description here

I found this from here. Hope this helps you too!

Upvotes: 0

ayunami2000
ayunami2000

Reputation: 459

For me on Windows 11, editing %APPDATA%\Docker\settings.json to the following values and then restarting Docker Desktop did the trick (I am using WSL2, not Hyper-V):

enter image description here

Upvotes: 10

Dhirendra Patil
Dhirendra Patil

Reputation: 19

It may be because docker daemon has choosen linux and broken try switching to windows or linux by using this command Launch powershell using administrator and run below command

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

Or open cmd prompt as administrator and rub below command

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

Upvotes: 0

Falco Alexander
Falco Alexander

Reputation: 3332

Be sure you start Powershell "as Administrator" that will also prevent the error you got from docker version .

these hints will be probably outdated as of 2021:

Then try to start the docker service: start-service docker If that fails delete the docker.pid file you will find with cd $env:programfiles\docker; rm docker.pid
Finally you should change HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\VSmbDisableOplocks to 0 or delete the value.

Upvotes: -3

Mitchell
Mitchell

Reputation: 71

You need the admin privilege to run the service

I had a similar issue. The problem goes away when I run command prompt ( run as an administrator", and type " docker version".

C:\WINDOWS\system32>docker version


Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b
 Built:             Wed Mar 11 01:23:10 2020
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       afacb8b
  Built:            Wed Mar 11 01:29:16 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Upvotes: 0

Joao Marques
Joao Marques

Reputation: 113

  1. Uninstall Docker in “Add or remove programs”
  2. Restart your computer
  3. Install Docker as Administrator (and not by running the installer directly)
  4. If the installer asks for a reboot, do it

Upvotes: 0

udoline
udoline

Reputation: 131

That's worked for me on win10-home https://github.com/docker/for-win/issues/11967

  1. Shutdown your service docker
  2. Now execute this into the window command terminal
    RMDIR /S %USERPROFILE%\AppData\Roaming\Docker
  3. Startup your service docker
  4. Now click on your "Docker Desktop"

The "Docker Desktop" will now runnig ... done ... :)

Upvotes: 4

Eugene Ihnatsyeu
Eugene Ihnatsyeu

Reputation: 1585

After unsuccessfully trying everything from these answers I simply upgraded to Windows 11

(In my case: 19043.1237 -> 22000.258)

Upvotes: -2

Rishab Jula
Rishab Jula

Reputation: 107

For Windows - Open 'Docker for Desktop' --> Go on debug icon -> Click on 'Reset to factory defaults'

Upvotes: 1

Brookie_C
Brookie_C

Reputation: 437

Make sure you have Hyper-V enabled, that was the problem in my case.

Upvotes: 2

ahmnouira
ahmnouira

Reputation: 3391

I had this issue, when am trying to create MySQL image using the command line

  • To fix this I just wait for the Docker Desktop app to start and running correctly then I tried again.enter image description here

Upvotes: 0

Manuel Larrota
Manuel Larrota

Reputation: 431

1.- Open the location of the shortcut:

shorcut

2.- Right click and properties and add "-SwitchDaemon" to destiny

enter image description here

3.- Give administrator permissions, advanced options:

enter image description here

4.- Restart windows.

Upvotes: 11

Devorein
Devorein

Reputation: 1319

The easiest way I fixed the issue is by terminating the docker desktop and restarting it again. If you see a blue-lit docker icon in the bottom left corner, then that means the docker daemon has started successfully, and the above error should be fixed.

Upvotes: -1

raven404
raven404

Reputation: 1197

The same issue arrived when I started with the docker in windows 10. I was able to run docker --version successfully but failed when I tried to run docker pull docker/whalesay.
I tried many things suggested in the answers over here but my issue was resolved when I followed the below steps:
1 . Search for docker in windows and run docker desktop as administrator.
2 . Check the bottom-left docker symbol it should be green if the docker is running.
3 . If it's not running first install "wsl_update".
4 . Open the docker desktop and sign in with your docker credentials, when you are logged in you can see the server restarting and the bottom left logo turns green.
5. To check whether docker is running or not open PowerShell as administrator and run docker run hello-world.

Upvotes: 5

Related Questions