Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Podman: automatic `--userns=keep-id` breaks containers using host networking

Open
#1,301 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
cli, devops

Research direction

Start in src/spec-node/singleContainer.ts at getPodmanArgs(), then compare how runArgs and --network=host are incorporated into the generated Podman command. Use the Alpine reproducer from the issue to verify the conflicting arguments, and confirm that an explicit user choice can prevent the failing automatic combination.

Written by the indexing model from the issue text.

Description

I'm facing an issue when using podman and --network=host combination:

Environment

  • @devcontainers/cli: 0.88.0
  • Podman client/server: 5.7.1
  • Host: WSL2
  • Podman server: rootful

Problem

For Podman on Linux and a non-root remoteUser, Dev Containers automatically adds:

--security-opt label=disable --userns=keep-id

See https://github.com/devcontainers/cli/issues/1004 and https://github.com/microsoft/vscode-remote-release/issues/10399.

When the configuration also requires --network=host, the container fails to start.

Minimal underlying reproducer

This fails:

podman run --rm \
  --network=host \
  --userns=keep-id \
  docker.io/library/alpine:3.20 \
  true

Error:

crun: mount `sysfs` to `sys`: Operation not permitted: OCI permission denied

Without --userns=keep-id, it succeeds:

podman run --rm \
  --network=host \
  docker.io/library/alpine:3.20 \
  true

The CLI-generated podman run command contains both:

--userns=keep-id --network=host

The automatic argument is added in:

src/spec-node/singleContainer.ts
getPodmanArgs()

Expected behavior

Users must be able to prevent the CLI from adding --userns=keep-id.

Possible fixes

No one is perfect I'm afraid.

  1. Do not add --userns=keep-id when --network=host is present.
  2. Add a setting or CLI option to disable automatic Podman arguments.
  3. Respect an explicit --userns=... in runArgs and do not add --userns=keep-id.
  4. Make automatic --userns=keep-id opt-in instead of unconditional for non-root users.

Big thanks.

Dominant language
TypeScript
Stars
3k
Forks
461
Avg merge
18m
Merged PRs (30d)
5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from devcontainers/cli

All issues in devcontainers/cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.