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

Unable to connect Windows client to WSL 2-hosted Podman #11386

Closed
fuglede opened this issue Sep 1, 2021 · 3 comments
Closed

Unable to connect Windows client to WSL 2-hosted Podman #11386

fuglede opened this issue Sep 1, 2021 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue

Comments

@fuglede
Copy link

fuglede commented Sep 1, 2021

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

I've been following this guide to get Podman up and running on WSL 2 (Ubuntu); everything works like a charm.

I then wanted to combine that with this other guide on using a Windows client to access the WSL 2-hosted Podman but start running into a few issues:

  • systemctl --user enable podman.socket does not produce any errors but at the same time, /run/user is empty, so I'm wondering if it does what it's supposed to.
  • sudo loginctl enable-linger $USER fails since, well, there's no systemd:
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to create bus connection: Host is down
  • podman --remote info tells me that there's no socket:
Error: cannot connect to the Podman socket, please verify that Podman REST API service is running: Get "http://d/v3.2.3/libpod/_ping": dial unix ///tmp/podman-run-1000/podman/podman.sock: connect: no such file or directory

On the client side, the SSH connection works as expected, but with no socket to point it to, I guess there's no hope of getting it up and running; in particular, using the socket from podman info on WSL 2 through something like

podman system connection add wsl2 --identity C:\users\myuser\.ssh\id_wsl2 ssh://[email protected]:2222/tmp/podman-run-1000/podman/podman.sock

gives rise to the following issue on podman info:

> podman info
Error: cannot connect to the Podman socket, please verify that Podman REST API service is running: Get "http://d/v3.3.1/libpod/_ping": ssh: rejected: connect failed (open failed)

So this all boils down to:

What's the intended way, if any, to connect a Windows client to WSL 2-hosted Podman?

Output of podman version:

$ podman version
Version:      3.2.3
API Version:  3.2.3
Go Version:   go1.15.2
Built:        Thu Jan  1 01:00:00 1970
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.21.3
  cgroupControllers: []
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: 'conmon: /usr/libexec/podman/conmon'
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.0.27, commit: '
  cpus: 12
  distribution:
    distribution: ubuntu
    version: "20.04"
  eventLogger: file
  hostname: myhostname
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.10.16.3-microsoft-standard-WSL2
  linkmode: dynamic
  memFree: 51510861824
  memTotal: 53726572544
  ociRuntime:
    name: crun
    package: 'crun: /usr/bin/crun'
    path: /usr/bin/crun
    version: |-
      crun version 0.20.1.5-925d-dirty
      commit: 0d42f1109fd73548f44b01b3e84d04a279e99d2e
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    path: /tmp/podman-run-1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: 'slirp4netns: /usr/bin/slirp4netns'
    version: |-
      slirp4netns version 1.1.8
      commit: unknown
      libslirp: 4.3.1-git
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.4.3
  swapFree: 13958643712
  swapTotal: 13958643712
  uptime: 3h 1m 17.45s (Approximately 0.12 days)
registries:
  search:
  - docker.io
  - quay.io
store:
  configFile: /home/myuser/.config/containers/storage.conf
  containerStore:
    number: 4
    paused: 0
    running: 0
    stopped: 4
  graphDriverName: overlay
  graphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: 'fuse-overlayfs: /usr/bin/fuse-overlayfs'
      Version: |-
        fusermount3 version: 3.9.0
        fuse-overlayfs: version 1.5
        FUSE library version 3.9.0
        using FUSE kernel interface version 7.31
  graphRoot: /home/myuser/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 11
  runRoot: /tmp/podman-run-1000/containers
  volumePath: /home/myuser/.local/share/containers/storage/volumes
version:
  APIVersion: 3.2.3
  Built: 0
  BuiltTime: Thu Jan  1 01:00:00 1970
  GitCommit: ""
  GoVersion: go1.15.2
  OsArch: linux/amd64
  Version: 3.2.3

Package info (e.g. output of rpm -q podman or apt list podman):

$ apt list podman
Listing... Done
podman/unknown,now 100:3.2.3-1 amd64 [installed]
podman/unknown 100:3.2.3-1 arm64
podman/unknown 100:3.2.3-1 armhf
podman/unknown 100:3.2.3-1 s390x

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)

Yes

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 1, 2021
@JayDoubleu
Copy link

What is the benefit of running remote podman against WSL2?

Why not just alias podman command to wsl podman?

https://docs.microsoft.com/en-us/windows/wsl/interop#:~:text=Run%20Linux%20binaries%20from%20the,.exe%20).&text=Binaries%20invoked%20in%20this%20way,as%20the%20WSL%20default%20user.

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Oct 14, 2021

Since we have had no response I am going to close this issue.

@rhatdan rhatdan closed this as completed Oct 14, 2021
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue
Projects
None yet
Development

No branches or pull requests

3 participants