Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Cannot run docker from windows. #636

Open
NimmiW opened this issue Mar 18, 2017 · 103 comments
Open

Cannot run docker from windows. #636

NimmiW opened this issue Mar 18, 2017 · 103 comments

Comments

@NimmiW
Copy link

NimmiW commented Mar 18, 2017

I installed docker windows toolkit and enabled the BIOS virtualization.

docker version gives the following:

Client: Version: 17.03.0-ce API version: 1.26 Go version: go1.7.5 Git commit: 60ccb22 Built: Thu Mar 2 01:11:00 2017 OS/Arch: windows/amd64 error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.26/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.

Now I am getting this error when trying to docker docker ps

error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.26/containers/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.

@NimmiW
Copy link
Author

NimmiW commented Mar 18, 2017

Can someone help me with this. I am a beginner.

@paladinram
Copy link

Same problem downloaded docker windows tool kit latest one yesterday and trying to do the installation in windows 10 and enabled BIOs
facing error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.26/containers/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.

Please help.. tried with many forums no luck

@bacongobbler
Copy link

bacongobbler commented Mar 23, 2017

Can you both confirm that you have a vm running under docker-machine? Usually that error indicates that you have the client installed but don't have an engine running.

From within cmder:

λ set | grep DOCKER
DOCKER_CERT_PATH=C:\Users\bacongobbler\.docker\machine\machines\deis
DOCKER_HOST=tcp://192.168.99.100:2376
DOCKER_MACHINE_NAME=deis
DOCKER_TLS_VERIFY=1
DOCKER_TOOLBOX_INSTALL_PATH=C:\Program Files\Docker Toolbox

λ docker-machine ls
NAME   ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER        ERRORS
deis   *        virtualbox   Running   tcp://192.168.99.100:2376           v17.03.0-ce

λ docker ps -a
time="2017-03-23T11:11:55-07:00" level=info msg="Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows"
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

λ docker pull busybox
time="2017-03-23T11:13:07-07:00" level=info msg="Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows"
Using default tag: latest
latest: Pulling from library/busybox
7520415ce762: Pull complete
Digest: sha256:32f093055929dbc23dec4d03e09dfe971f5973a9ca5cf059cbfb644c206aa83f
Status: Downloaded newer image for busybox:latest

@paladinram
Copy link

I installed only the docker toolbox.. didn't download any docker machine separately. please guide

@bacongobbler
Copy link

It's part of the docker toolbox. Use docker-machine create box.

@paladinram
Copy link

ok, I will create it now

@bacongobbler
Copy link

bacongobbler commented Mar 23, 2017

I'm going to un-sub from this discussion, but please make sure to follow the official documentation as descibed in great detail here: https://docs.docker.com/toolbox/toolbox_install_windows/

I'm not a Docker dev, just some bum who decided to try out Docker on Windows. Cheers.

@paladinram
Copy link

ok, Thanks

@paladinram
Copy link

just a qq: I done with machine.I can see the machine version too.. but when I execute docker ps
facing error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.26/containers/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.

getting same error..

@bacongobbler
Copy link

bacongobbler commented Mar 23, 2017

Did you set the environment variables as suggested? See my comment above on set output. Those can be fetched with docker-machine env box.

Please follow through the documentation.

@paladinram
Copy link

paladinram commented Mar 23, 2017

Yes, please see below:
C:\Users\xxxxx>set DOCKER
DOCKER_CERT_PATH=C:\Users\Tarangini.docker\machine\machines\deis
DOCKER_HOST=tcp://192.168.99.1:50675
DOCKER_MACHINE_NAME=deis
DOCKER_TLS_VERIFY=1
DOCKER_TOOLBOX_INSTALL_PATH=C:\Program Files\Docker Toolbox

@paladinram
Copy link

C:\Users\Tarangini>docker ps
time="2017-03-23T15:59:43-05:00" level=info msg="Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows"
could not read CA certificate "C:\Users\Tarangini\.docker\machine\machines\deis\ca.pem": open C:\Users\Tarangini.docker\machine\machines\deis\ca.pem: The system cannot find the file specified.

@paladinram
Copy link

Appreciating your help for the beginners.. you can see what am getting

C:\Users\Tarangini>docker run hello-world
time="2017-03-23T16:05:42-05:00" level=info msg="Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows"
could not read CA certificate "C:\Users\Tarangini\.docker\machine\machines\deis\ca.pem": open C:\Users\Tarangini.docker\machine\machines\deis\ca.pem: The system cannot find the file specified.

@paladinram
Copy link

Tarangini@Tara MINGW64 ~
$ docker -v
time="2017-03-23T16:35:39-05:00" level=info msg="Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows"
could not read CA certificate "C:\Users\Tarangini\.docker\machine\machines\deis\ca.pem": open C:\Users\Tarangini.docker\machine\machines\deis\ca.pem: The system cannot find the file specified.

Tarangini@Tara MINGW64 ~
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default virtualbox Timeout
deis virtualbox Timeout

Tarangini@Tara MINGW64 ~
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default virtualbox Timeout
deis virtualbox Timeout

Tarangini@Tara MINGW64 ~
$ docker-machine env
Error checking TLS connection: ssh command error:
command : ip addr show
err : exit status 255
output :

Tarangini@Tara MINGW64 ~

@ntomer
Copy link

ntomer commented May 11, 2017

Try using the default 'Docker Quickstart Terminal' shortcut to run your commands. That worked for me.

@popey456963
Copy link

@ntomer That works, but isn't optimal for people who use an external command prompt, like cmder.exe.

@ngetahun
Copy link

ngetahun commented Jul 12, 2017

@paladinram make sure the docker machine default name is 'deis'.

@sebastiansterk
Copy link

sebastiansterk commented Jul 26, 2017

Try this, solved my problem:

docker-machine env --shell cmd default 
@FOR /f "tokens=*" %i IN ('docker-machine env --shell cmd default') DO @%i

Replace "default" by your docker VM name

@nsidhaye
Copy link

nsidhaye commented Aug 6, 2017

Thanks @Owhen

docker-machine env --shell cmd default 
@FOR /f "tokens=*" %i IN ('docker-machine env --shell cmd default') DO @%i

works

@siran
Copy link

siran commented Aug 11, 2017

Im on Win10 but I tried installing Docker Toolbox and running

docker run hello-world

But the error is issued:
docker: error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.30/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.
See 'docker run --help'.

Already tried many suggestions of this thread, but its still no working.

Any ideas?

@adrianwright
Copy link

I encountered this because I had disabled the Hyper-V service in Windows so that I could run VirtualBox. After a reboot, Docker notified me that the service needed to be running (which would keep VirtualBox from functioning). This resolved the issue.

@siran
Copy link

siran commented Aug 16, 2017

Hyper-V apparently is for Windows 10. I'm trying to use Docker Toolbox because we need support for older versions of Windows, not only 10. I still can't run hello-world as described in Docker Toolbox's documentation

@jsmithe
Copy link

jsmithe commented Aug 22, 2017

@siran While using Docker Toolbox installation are attempting commands from the Docker Quickstart Terminal or something else? If you are using another terminal try 'docker-machine ssh default' (assuming you are using default). From their you can run 'docker images', 'docker info', 'docker ps', etc.

@vinayk8125
Copy link

try after install the virtualbox in "Program Files\Docker Toolbox\installers\virtualbox\virtualbox.msi"

@IllyaMoskvin
Copy link

I was getting this error. The approximate steps I took are as follows:

  1. Run Kitematic (Alpha) and choose to create the Docker VM.
  2. Run cd "/c/path/to/docker toolbox"; ./start.sh in your terminal

I had to run Kitematic twice, since the first time it ran out of buffer or something to that effect. The operation completed successfully on my second try.

The "Docker Quickstart Terminal" shortcut just runs start.sh, so if you are using a different command prompt (e.g. cmder.exe), just change your shortcut target as follows:

"C:\path\to\cmder.exe" -c "cd '/c/path/to/docker toolbox'; ./start.sh"

There's a related issue where start.sh will not run when you are not within its directory, thus you need to cd into wherever you've installed Docker Toolbox in order to get it to work, until that issue is resolved (#687). Just make sure to quote your paths if they contain spaces.

@polotto
Copy link

polotto commented Sep 4, 2017

I followed the @bacongobbler answer and I make some changes to work with Docker inside the PowerShell. I using Docker Tools on Windows 7.

First, list all machines: docker-machine ls
If you don't have one, you can create one with: docker-machine create default
Start the machine, if stopped: docker-machine start default
Connect with machine via SSH: docker-machine ssh default

Now, you can use the docker inside the PowerShell or even inside the Hyper (https://hyper.is).

@navarq
Copy link

navarq commented Sep 8, 2017

This problem occurred after the recent update.

I am using windows 10 pro

Simply restarting my machine solved the issue.

@mohdamir
Copy link

mohdamir commented Sep 8, 2017

I have moved the docker bin path to last in PATH environment variable and this worked for me.

@lijo-george
Copy link

For me, this error was resolved after I removed 'daemon.json' file in "%programdata%\docker\config"

The content in my 'daemon.json' is the following:

{

"hosts": ["tcp://0.0.0.0:2375"]

}

I created this manually as part of some testing. But after I restarted the server, I started to get the error in this question

@tmithun
Copy link

tmithun commented Mar 22, 2019

Kill the docker from the task manager and run it again as admin...it solved my problem

@fernandokbs
Copy link

My problem was because, I installed docker toolbox. I unistalled it, and the I installed docker for windows.

I had to unistall docker for windows remove the ~/.docker, and delete all DOCKER enviroment variables.
It solved my problem.

@ghost
Copy link

ghost commented Apr 15, 2019

What worked for me was:
1 - https://success.docker.com/article/docker-for-windows-fails-with-a-daemon-not-running-message
2 - Opening hyper-v manager and restarting any VM related to docker
3 - restarting docker desktop and restart computer

Not sure if all steps are needed though XD

@ZiadJ
Copy link

ZiadJ commented Apr 27, 2019

The VM was actually running in a Windows OS rather than Linux for me so clicking on the Switch to Linux Containers menu solved it on my machine. Hope that helps someone in the same situation.

@ibenjelloun
Copy link

I had this error while trying to start my docker environment :

ERROR: Windows named pipe error: The system cannot find the file specified. (code: 2)

A look into the Hyper-V Manager and the MobyLinuxVM was not created.
What I did to fix : I just quitted Docker Desktop and started it again.

Windows 10/Docker For Windows

@olisteadman
Copy link

For me the error was resolved by stopping a virtual Ubuntu instance that'd been running in Hyper-V:

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.

Once Ubuntu instance had been stopped, and Docker Desktop had been restarted, my usual docker commands ran just fine.

PS: I had the idea to try this because of an Error Log that Docker Desktop had helpfully compiled and offered to send to Docker Hub as user feedback... the log appeared to indicate that my machine was short on RAM, and Docker was failing for this very simple reason. Killing the Ubuntu instance solved that.

@privojaime
Copy link

Ran into this issue trying to just run docker info

The only solution that worked for me was...

Turn on Docker Desktop
Open Powershell with 'Run as Administrator'

Everything else threw this error.

@mabez
Copy link

mabez commented Jun 11, 2019

My case, I removed the VM and recreated it trhow the commands:
$ docker-machine rm default
$ docker-machine create default

@elycheikh1
Copy link

I think you should run docker you install it but it is not running. I had the same issue when I run "docker container ls --all"
After running the docker the issue disappear . I am on windows 10

@mayankgaur
Copy link

mayankgaur commented Jul 3, 2019

I have resolved this issue by following steps
A.

  1. Start-Service “Hyper-V Virtual Machine Management”
  2. Start-Service "Hyper-V Host Compute Service"

OR

B. If you get any error then apply below steps:-

1, Open "Window Security"

2, Open "App & Browser control"

3, Click "Exploit protection settings" at the bottom

4, Switch to "Program settings" tab

5, Locate "C:\WINDOWS\System32\vmcompute.exe" in the list and expand it

6, Click "Edit"

7, Scroll down to "Code flow guard (CFG)" and uncheck "Override system settings"

8, Start vmcompute from powershell "net start vmcompute"

Then Please restart your system

@ghost
Copy link

ghost commented Jul 19, 2019

docker-machine ls
in case you don't have a running machine
docker-machine start
then execute
docker-machine env | Invoke-Expression
or specify machine name
docker-machine env machine_name | Invoke-Expression

@fkromer
Copy link

fkromer commented Aug 2, 2019

@just-tool I followed the installation instructions but the your solution does not work for me and I didn't find a reason for that so far. Have you stumbled over this issue as well?

PS C:\Users\Florian> docker
<docker cli help is displayed like expected>
PS C:\Users\Florian> docker-machine ls
NAME   ACTIVE   DRIVER   STATE   URL   SWARM   DOCKER   ERRORS
PS C:\Users\Florian> docker-machine start
Error: No machine name(s) specified and no "default" machine exists

Seems to be a quite common issue. Would be great to find some hints about this topic in the official docs in case the issue has been closed and a single solution has been found which works for everyone.

BTW: Does anyone know if Docker for Windows (for Win 10 Pro/Enterprise, instead of for Win 10 Home) can be setup without issues right away?

@fkromer
Copy link

fkromer commented Aug 5, 2019

When I installed Windows Toolbox the first time the desktop icon "Docker Quickstart Terminal" did not work. Unfortunatelly I don't know what error was returned when I tried to run via the icon back then. The commands don't work when they are executed in PS. The commands do only work in the terminal which is created when executing the desktop icon cause it spawns a bash using MINGW. The second time I installed Docker Toolbox I selected "Docker Compose for Windows", "VirtualBox" and "Git for Windows". The first time I did not select "Git for Windows" during installation. Seems like the MINGW environment is installed implicitly with this last option. At least docker run hello-world runs now.

@fkromer
Copy link

fkromer commented Aug 8, 2019

BTW: Does anyone know if Docker for Windows (for Win 10 Pro/Enterprise, instead of for Win 10 Home) can be setup without issues right away?

As I had no trouble with "Docker for Windows" at all and due a lot of other advantages (no legacy software, native virtualization with Hyper-V instead of Docker Container in VirtualBox VM, native Docker Engine for Windows instead of Docker Engine for Linux running in boot2docker, etc.) I highly recommend to use it instead of "Docker Toolbox".

@guandaxia
Copy link

I use babun.exe on Windows 10 , docker-toolbox

 eval $(docker-machine env default)

is worked for me.

if use cmd.exe

@FOR /f "tokens=*" %i IN ('docker-machine env default') DO @%i

@santhosh2759
Copy link

system tray -> docker icon -> settings -> advanced

adjust the memory to 1280

@benquinteros
Copy link

I encountered the same error when running docker on a AzureDevOps Agent self hosted vm.

What fixed it for me was adding the network service user to the docker users group.

@Ather23
Copy link

Ather23 commented Nov 29, 2019

The following steps worked for me:
1- Kill docker desktop
2- Kill any docker daemon running in the background
3- Start Docker Desktop as administrator

@egorpavlikhin
Copy link

I encountered the same error when running docker on a AzureDevOps Agent self hosted vm.

What fixed it for me was adding the network service user to the docker users group.

Did you restart your machine after that?

@domicoder
Copy link

docker-machine ls
in case you don't have a running machine
docker-machine start
then execute
docker-machine env | Invoke-Expression
or specify machine name
docker-machine env machine_name | Invoke-Expression

It's work for me.

@ErimTuzcuoglu
Copy link

It's part of the docker toolbox. Use docker-machine create box.

It worked perfectly on windows 8.1.

@antoniskak
Copy link

Installed Docker toolbox for Windows 10 Home and had the same issue:

C:\Program Files\Docker Toolbox\docker.exe: 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.
See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.

To solve this in /c/Program Files/Docker Toolbox run

docker-machine create box

then to see how to connect your Docker Client to the Docker Engine running on the virtual machine created run:

docker-machine env box

This will give you the command to run in order to configure your shell:

eval $("C:\Program Files\Docker Toolbox\docker-machine.exe" env box)

Check that the installation is running correctly by running

docker run hello-world

@krbg
Copy link

krbg commented Apr 24, 2020

Installed Docker toolbox for Windows 10 Home and had the same issue:

C:\Program Files\Docker Toolbox\docker.exe: 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.
See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.

To solve this in /c/Program Files/Docker Toolbox run

docker-machine create box

then to see how to connect your Docker Client to the Docker Engine running on the virtual machine created run:

docker-machine env box

This will give you the command to run in order to configure your shell:

eval $("C:\Program Files\Docker Toolbox\docker-machine.exe" env box)

Check that the installation is running correctly by running

docker run hello-world

This worked perfectly on Win 10 with Docker toolbox. Nothing else worked. Thanks @antoniokak

@tylercranston
Copy link

For me, this error was resolved after I removed 'daemon.json' file in "%programdata%\docker\config"

The content in my 'daemon.json' is the following:

{

"hosts": ["tcp://0.0.0.0:2375"]

}

I created this manually as part of some testing. But after I restarted the server, I started to get the error in this question

I added "npipe://" to daemon.json and that fixed the issue for me:

{
"hosts": ["tcp://0.0.0.0:2375", "npipe://"]
}

@Gander7
Copy link

Gander7 commented May 22, 2020

@antoniokak Thank you so much. Exactly what I needed after much frustrating troubleshooting.
The only update is the docker-machine env box gave me the command to run and I didn't need to use eval. :)

@hoanganh130893
Copy link

hoanganh130893 commented May 27, 2020

Hey this is an easy way to fix this:
Try to run this command :
docker-machine env
You will see this:
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="C:\Users<your-device-name>.docker\machine\machines\default"
export DOCKER_MACHINE_NAME="default"
export COMPOSE_CONVERT_WINDOWS_PATHS="true"

Run this command to configure your shell:

eval $("C:\Program Files\Docker Toolbox\docker-machine.exe" env)

then run this command on your shell
eval $("C:\Program Files\Docker Toolbox\docker-machine.exe" env)

=> Your problem was solved
image

@AnujSR02
Copy link

Installing the latest version of Oracle Virtual Box resolved this issue for the Windows.

@DiegoSilvadv
Copy link

Cheguei aqui agora, verifiquem no inicializar do windows se está habilitado o docker desktop e deixa habilitado, resolveu comigo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests