claude-code - 💡(How to fix) Fix Sandbox broken on Linux kernel 6.17: apply-seccomp: write /proc/self/setgroups (nested userns is capability-restricted) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56345Fetched 2026-05-06 06:30:38
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Error Message

  • Claude Code embeds its own bubblewrap implementation (error string found in binary) — not calling system bwrap

Root Cause

Root cause hypothesis

Fix Action

Workaround

Disable sandbox: "sandbox": { "enabled": false }

Code Example

{
  "sandbox": {
    "enabled": true,
    "autoAllowBashIfSandboxed": true
  }
}

---

apply-seccomp: write /proc/self/setgroups (nested userns is capability-restricted; caller must provide CAP_SYS_ADMIN): Permission denied
RAW_BUFFERClick to expand / collapse

Bug Report

Environment

  • Claude Code version: 2.1.128
  • OS: Ubuntu (Linux)
  • Kernel: 6.17.0-23-generic
  • bubblewrap: 0.11.0 (/usr/bin/bwrap)
  • socat: installed

Configuration (settings.local.json)

{
  "sandbox": {
    "enabled": true,
    "autoAllowBashIfSandboxed": true
  }
}

Also tried with "enableWeakerNestedSandbox": true — no effect.

What happens

Every sandboxed Bash command fails with:

apply-seccomp: write /proc/self/setgroups (nested userns is capability-restricted; caller must provide CAP_SYS_ADMIN): Permission denied

What was verified

  • System bwrap --unshare-all --new-session echo ok works fine
  • socat is installed
  • kernel.apparmor_restrict_unprivileged_userns = 0 (disabled)
  • kernel.unprivileged_userns_clone = 1
  • user.max_user_namespaces = 63565
  • Claude Code process is unconfined (AppArmor): cat /proc/self/attr/currentunconfined
  • No seccomp filter on Claude Code process: Seccomp: 0, Seccomp_filters: 0
  • Claude Code embeds its own bubblewrap implementation (error string found in binary) — not calling system bwrap

Root cause hypothesis

Claude Code's embedded bubblewrap is incompatible with kernel 6.17. The system bwrap 0.11.0 works, but the embedded version fails. Likely a kernel 6.17 change in how write /proc/self/setgroups is handled during user namespace setup.

enableWeakerNestedSandbox: true does not resolve the issue.

Workaround

Disable sandbox: "sandbox": { "enabled": false }

extent analysis

TL;DR

Disable the sandbox by setting "sandbox": { "enabled": false } in the settings.local.json configuration to workaround the issue.

Guidance

  • The error message suggests a permission issue related to CAP_SYS_ADMIN capability, which is required for setting up user namespaces.
  • The fact that the system bwrap works fine, but the embedded bubblewrap in Claude Code fails, points towards a compatibility issue with kernel 6.17.
  • Disabling the sandbox is a viable workaround, but it may have security implications that should be considered.
  • To verify the workaround, try running a sandboxed Bash command after disabling the sandbox and check if it succeeds without the Permission denied error.

Example

No code snippet is necessary in this case, as the workaround involves modifying the configuration file.

Notes

The root cause of the issue is likely related to the embedded bubblewrap implementation in Claude Code being incompatible with kernel 6.17. Disabling the sandbox may not be a permanent solution and may have security implications.

Recommendation

Apply the workaround by disabling the sandbox, as it is a straightforward and effective solution to the problem, although it may require further investigation to find a more permanent fix that balances security and functionality.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING