Cannot connect to the Docker daemon in Rancher Desktop

Hi. I am following a Debezium tutorial and I am trying to use Rancher-Desktop. In the tutorial, it says to run the following, but I get:

PS C:\WINDOWS\system32> wsl.exe --distribution rancher-desktop docker run -it --rm --name zookeeper -p 2181:2181 -p 2888:2888 -p 3888:3888 quay.io/debezium/zookeeper:3.0
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.

I’m not sure how to resolve this from:

PS C:\WINDOWS\system32> dockerd --register-service --service-name docker --group docker-users --config-file C:\docker\config\windows-daemon.json
The specified service already exists.



PS C:\WINDOWS\system32> wsl.exe -l -v
  NAME                    STATE           VERSION
* openSUSE-Tumbleweed     Stopped         2
  rancher-desktop-data    Stopped         2
  rancher-desktop         Running         2


PS C:\WINDOWS\system32> wsl.exe docker info
Client:
 Version:    27.2.1-rd
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.17.1
    Path:     /mnt/c/Program Files/Rancher Desktop/resources/resources/linux/docker-cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.29.5
    Path:     /mnt/c/Program Files/Rancher Desktop/resources/resources/linux/docker-cli-plugins/docker-compose

Server:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
errors pretty printing info



PS C:\WINDOWS\system32> docker context ls
NAME            DESCRIPTION                               DOCKER ENDPOINT                             ERROR
default *       Current DOCKER_HOST based configuration   npipe:////./pipe/docker_engine
desktop-linux   Docker Desktop                            npipe:////./pipe/dockerDesktopLinuxEngine

PS C:\WINDOWS\system32> wsl.exe docker context ls
NAME        DESCRIPTION                               DOCKER ENDPOINT               ERROR
default *   Current DOCKER_HOST based configuration   unix:///var/run/docker.sock

PS C:\WINDOWS\system32> docker context show
default

PS C:\WINDOWS\system32> docker context inspect --format '{{ .Endpoints.docker.Host }}'
npipe:////./pipe/docker_engine

PS C:\WINDOWS\system32> wsl.exe docker context inspect --format '{{ .Endpoints.docker.Host }}'
unix:///var/run/docker.sock




PS C:\WINDOWS\system32> wsl.exe pidof dockerd
nothing


PS C:\WINDOWS\system32> wsl.exe dockerd --register-service --service-name docker --group docker-users --config-file C:\docker\config\windows-daemon.json
/bin/bash: line 1: dockerd: command not found
PS C:\WINDOWS\system32> wsl.exe snap list docker
/bin/bash: line 1: snap: command not found
PS C:\WINDOWS\system32> wsl.exe dnf list --installed 'docker*'
/bin/bash: line 1: dnf: command not found
PS C:\WINDOWS\system32> wsl.exe yum list --installed 'docker*'
/bin/bash: line 1: yum: command not found
PS C:\WINDOWS\system32> wsl.exe apt list --installed 'docker*'
/bin/bash: line 1: apt: command not found
PS C:\WINDOWS\system32> wsl.exe snap services
/bin/bash: line 1: snap: command not found
PS C:\WINDOWS\system32> wsl.exe file /var/run/docker.sock
/bin/bash: line 1: file: command not found


PS C:\WINDOWS\system32> wsl.exe ps auxf
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   2616  1756 hvc0     Sl+  10:02   0:00 /init
root         5  0.0  0.0   2616     4 hvc0     Sl+  10:02   0:00 plan9 --control-socket 5 --log-level 4 --server-fd 6 --pipe-fd 8 --log-truncate
root         9  0.0  0.0   2616   120 ?        Ss   10:02   0:00 /init
root        10  0.0  0.0   2616   120 ?        S    10:02   0:00  \_ /init
catchar+    11  0.0  0.0   8320  3816 pts/0    Rs+  10:02   0:00      \_ ps auxf


PS C:\WINDOWS\system32> Get-Process | Select-String docker
System.Diagnostics.Process (dockerd)



PS C:\WINDOWS\system32> wsl.exe systemctl --user status docker
Failed to connect to user scope bus via local transport: No such file or directory

Please, format your post according to the following guide: How to format your forum posts
In short: please, use </> button to share codes, terminal outputs, error messages or anything that can contain special characters which would be interpreted by the MarkDown filter. Use the preview feature to make sure your text is formatted as you would expect it and check your post after you have sent it so you can still fix it.

Example code block:

```
echo "I am a code."
echo "An athletic one, and I wanna run."
```

After fixing your post, please send a new comment so people are notified about the fixed content.


Hi @rimelek I have applied the pre-formatted text to the above post for your response.

You were not supposeed to put the whole post into a single code block, only the code. I fixed it for you now.

Also you are using Rancher DEsktop, which is not Docker DEsktop, so I moved your question out of the Docker Desktop related topic.

Regarding the error message, I made a blogpost about this recently, which I shared on the forum as well

I haven’t mentioned Rancher Desktop directly in that post, but you can find links to previous posts where I did. How it.

Your commands show that your current wsl distro is an opensuse. I don’t know if Rancher Desktop supports WSL integration. If not, run your commands directly on the Windows host.

Based on Docker Desktop, I can say you should not expect finding a dockerd process in your custom wsl distro as it will run in the docker desktop distribution. In case of Rancher dEsktop, it must be “rancher-desktop”.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.