cli icon indicating copy to clipboard operation
cli copied to clipboard

DevContainer with Podman Desktop

Open GrantAnt opened this issue 2 years ago • 2 comments

Steps to reproduce:

  1. I have installed Podman Desktop (since Ubuntu does not offer Podman 4.X out of the box) and installed a new WSL "podman-machine-default"
  2. I cloned a git projet directly to wsl and opened it with VSCode container DevContainer Extension
  3. I create a Dockerfile and devcontainer.json
  4. I click "Reopen in Container"

When I use plain Ubuntu-22:04 WSL, install Podman 4.X via Ubuntu-Backports, everything works fine. But Backports are blocked within certain environments. Therefore Podman.

Problem: Container does not start with error:

[3840158 ms] Start: Run in container: for pid in `cd /proc && ls -d [0-9]*`; do { echo $pid ; readlink /proc/$pid/cwd || echo ; readlink /proc/$pid/ns/mnt || echo ; cat /proc/$pid/stat | tr 
[3840705 ms] Stop (547 ms): Run in container: for pid in `cd /proc && ls -d [0-9]*`; do { echo $pid ; readlink /proc/$pid/cwd || echo ; readlink /proc/$pid/ns/mnt || echo ; cat /proc/$pid/stat | tr "
[3840708 ms] userEnvProbe is taking longer than 2 seconds. Process tree:
  56100: /bin/bash -lic echo -n c41921ba-9b4d-4c6a-a2c0-c8ef2742402f; cat /proc/self/environ; echo -n c41921ba-9b4d-4c6a-a2c0-c8ef2742402f 
    56114: /bin/bash /usr/local/bin/enterns 
      56119: sudo nsenter -m -p -t 18 --wd=/home/user/repos/specific_twchwinf_edge su -l user 
        56120: nsenter -m -p -t 18 --wd=/home/user/repos/specific_twchwinf_edge su -l user 
          56121: su -l user 
            56125: -bash 
[3840710 ms] Stop (555 ms): Run in Host: /bin/sh 
[3848157 ms] userEnvProbe is taking longer than 10 seconds. Avoid waiting for user input in your shell's startup scripts. Continuing.
[3848182 ms] Start: Run in Host: podman version --format {{.Server.APIVersion}}
[3848210 ms] Stop (28 ms): Run in Host: podman version --format {{.Server.APIVersion}}
[3848210 ms] 4.7.2
[3848246 ms] Start: Run in Host: /home/user/.vscode-remote-containers/bin/1a5daa3a0231a0fbba4f14db7ec463cf99d7768e/node /home/user/.vscode-remote-containers/dist/dev-containers-cli-0.321.0/dist/spec-node/devContainersSpecCLI.js read-configuration --docker-path podman --workspace-folder /home/user/repos/specific_twchwinf_edge --log-level trace --log-format json --config /home/user/repos/specific_twchwinf_edge/.devcontainer/devcontainer.json --include-merged-configuration --mount-workspace-git-root --terminal-columns 187 --terminal-rows 15
[3848375 ms] @devcontainers/cli 0.52.1. Node.js v18.15.0. linux 5.15.133.1-microsoft-standard-WSL2 x64.
[3848375 ms] Start: Run: git rev-parse --show-cdup
[3848381 ms] Stop (6 ms): Run: git rev-parse --show-cdup
[3848382 ms] Start: Run: podman ps -q -a --filter label=devcontainer.local_folder=/home/user/repos/specific_twchwinf_edge --filter label=devcontainer.config_file=/home/user/repos/specific_twchwinf_edge/.devcontainer/devcontainer.json
[3848417 ms] Stop (35 ms): Run: podman ps -q -a --filter label=devcontainer.local_folder=/home/user/repos/specific_twchwinf_edge --filter label=devcontainer.config_file=/home/user/repos/specific_twchwinf_edge/.devcontainer/devcontainer.json
[3848418 ms] Command failed: podman ps -q -a --filter label=devcontainer.local_folder=/home/user/repos/specific_twchwinf_edge --filter label=devcontainer.config_file=/home/user/repos/specific_twchwinf_edge/.devcontainer/devcontainer.json
[3848425 ms] Stop (179 ms): Run in Host: /home/user/.vscode-remote-containers/bin/1a5daa3a0231a0fbba4f14db7ec463cf99d7768e/node /home/user/.vscode-remote-containers/dist/dev-containers-cli-0.321.0/dist/spec-node/devContainersSpecCLI.js read-configuration --docker-path podman --workspace-folder /home/user/repos/specific_twchwinf_edge --log-level trace --log-format json --config /home/user/repos/specific_twchwinf_edge/.devcontainer/devcontainer.json --include-merged-configuration --mount-workspace-git-root --terminal-columns 187 --terminal-rows 15
[3848425 ms] Exit code 1
[3848426 ms] Command failed: /home/user/.vscode-remote-containers/bin/1a5daa3a0231a0fbba4f14db7ec463cf99d7768e/node /home/user/.vscode-remote-containers/dist/dev-containers-cli-0.321.0/dist/spec-node/devContainersSpecCLI.js read-configuration --docker-path podman --workspace-folder /home/user/repos/specific_twchwinf_edge --log-level trace --log-format json --config /home/user/repos/specific_twchwinf_edge/.devcontainer/devcontainer.json --include-merged-configuration --mount-workspace-git-root --terminal-columns 187 --terminal-rows 15
[3848427 ms] Exit code 1

Debug Information: uname -a

Linux hd1pcms0536 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64 GNU/Linux

podman version 4.7.2

GrantAnt avatar Nov 21 '23 10:11 GrantAnt

Hi 👋

Thanks for opening the issue, this looks very similar to https://github.com/microsoft/vscode-remote-release/issues/9192

From https://github.com/microsoft/vscode-remote-release/issues/9192#issuecomment-1812693851, v0.315.1 of Dev containers extension work for them. Hence, I wonder if there's a regression, looping in @chrmarti

samruddhikhandale avatar Nov 22 '23 20:11 samruddhikhandale

@GrantAnt The printed process tree shows that the user environment probe blocks on bash being run interactively in your shell config scripts in WSL. Try commenting that out to make the environment probe pass, you might be missing some environment variables otherwise.

The error is from podman ps. Does that work when you run it manually in WSL?

podman ps -q -a --filter label=devcontainer.local_folder=/home/user/repos/specific_twchwinf_edge --filter label=devcontainer.config_file=/home/user/repos/specific_twchwinf_edge/.devcontainer/devcontainer.json

chrmarti avatar Nov 24 '23 10:11 chrmarti