Podman: SELinux detection fails when VS Code runs inside Flatpak (label=disable needed)

Open
#1,071 2 comments 0 reactions 1 assignee View on GitHub

@v-Kaniska244 is already working on this.

Since Sep 24, 2025.

Assessment

This issue has not been assessed yet.

Description

Description

When using VS Code with Podman + SELinux, VS Code currently detects an SELinux-enabled environment by calling getenforce and checking .Host.Security.SELinuxEnabled. If VS Code is running inside a Flatpak, getenforce inside the Flatpak returns "Disabled" even though the host is "Enforcing". That makes VS Code think SELinux is not enabled and it does not pass label=disable, causing permission/SELinux denial issues when building containers with features. If I manually make getenforce return "Enforcing" inside the Flatpak, detection succeeds and the container build works.

Environment

  • Host OS: Fedora (or another SELinux‑enforcing distribution).
  • VS Code as Flatpak: com.visualstudio.code + com.visualstudio.code.tool.podman.
  • Podman version: 5.6.1
  • VS Code version: 1.102.1

Steps to reproduce

  1. Click "Dev Containers: Reopen in Container" from VS Code.

Actual behavior

  • Inside a Flatpak sandbox, getenforce reports Disabled and detection fails, so label=disable is not set and builds fail.

Expected behavior

  • VS Code should correctly detect the host SELinux state when running inside Flatpak sandboxes and pass label=disable when necessary to avoid SELinux denial issues with Podman.

Suggested fixes / discussion

  • Consider additional detection strategies when running inside Flatpak.
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.