Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker WSL2 integration fails when non Bourne compatible shell set as default shell - e.g. fish, csh, tcsh #13783

Closed
insanityinside opened this issue Nov 7, 2023 · 3 comments

Comments

@insanityinside
Copy link

insanityinside commented Nov 7, 2023

Description

If the default user shell is set to a non-Bourne shell, the /var/run/docker.sock socket is not created. Attempting to run docker ps results in the error Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?. In my case, I had the fish shell installed. This has not previously been an issue, I believe the issue was introduced in Docker Desktop 4.25.0, as it has only started occurring recently on my machine.

This does not appear to affect the Docker binaries, which are correctly linked from /usr/bin (docker, docker-compose etc) to /mnt/wsl/docker-desktop/cli-tools/usr/bin/ as you'd expect.

Tested against WSL2 versions of Ubuntu and Rocky Linux 8, to eliminate distribution dependent issues.

Reproduce

  • Install WSL2 and add a distribution
  • Install the fish, csh or tcsh shells in the distribution
  • Change the user shell to the new shell (e.g. chsh -s /usr/bin/fish)
  • Log out of WSL2
  • Shut down WSL with wsl --shutdown in a powershell/command window
  • Install Docker Desktop 4.25.0
  • Ensure it is set with the WSL2 engine and with the WSL2 integration for the chosen integration (or default if applicable)
  • Load a new WSL2 terminal window
  • run docker ps
  • Observe error Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
  • Observe missing /var/run/docker.sock and /var/run/docker-cli.sock files

If the shell is then changed back to /usr/bin/bash, then the instance is terminated using wsl --terminate [distribution name] at a Windows command prompt, then the instance reloaded, the expected behaviour returns. Sometimes also required a restart of the Docker Desktop software.

Confirmed behaviour does not occur with bash, sh, dash and zsh as the user shell.

Expected behavior

Standard empty image list
$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

docker version

Client: Docker Engine - Community
 Cloud integration: v1.0.35+desktop.5
 Version:           24.0.6
 API version:       1.43
 Go version:        go1.20.7
 Git commit:        ed223bc
 Built:             Mon Sep  4 12:32:16 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Desktop
 Engine:
  Version:          24.0.6
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.7
  Git commit:       1a79695
  Built:            Mon Sep  4 12:32:16 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.22
  GitCommit:        8165feabfdfe38c65b599c4993d227328c231fca
 runc:
  Version:          1.1.8
  GitCommit:        v1.1.8-0-g82f18fe
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client: Docker Engine - Community
 Version:    24.0.6
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.11.2-desktop.5
    Path:     /usr/local/lib/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.23.0-desktop.1
    Path:     /usr/local/lib/docker/cli-plugins/docker-compose
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     /usr/local/lib/docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.20
    Path:     /usr/local/lib/docker/cli-plugins/docker-extension
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v0.1.0-beta.9
    Path:     /usr/local/lib/docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /usr/local/lib/docker/cli-plugins/docker-sbom
  scan: Docker Scan (Docker Inc.)
    Version:  v0.26.0
    Path:     /usr/local/lib/docker/cli-plugins/docker-scan
  scout: Docker Scout (Docker Inc.)
    Version:  v1.0.9
    Path:     /usr/local/lib/docker/cli-plugins/docker-scout

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 24.0.6
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 8165feabfdfe38c65b599c4993d227328c231fca
 runc version: v1.1.8-0-g82f18fe
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
 Kernel Version: 5.15.90.1-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 31.35GiB
 Name: UKIW2T3FRG3
 ID: 5d602008-7770-4868-a693-44d9a17d29a4
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
WARNING: daemon is not using the default seccomp profile

Diagnostics ID

8FED7B34-8F81-4B7E-B47F-4E7D6C869FC9/20231107115031

Additional Info

No response

@bsousaa
Copy link
Contributor

bsousaa commented Nov 7, 2023

This should be a duplicate of #13764. Can you try this build #13764 (comment) ?

@insanityinside
Copy link
Author

Can confirm the new build fixes the issue. Apologies for the duplicate, I'd scanned through tickets and hadn't spotted one being related.

@chelnak
Copy link

chelnak commented Nov 7, 2023

Great news. Thanks @insanityinside

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

No branches or pull requests

3 participants