claude-code - 💡(How to fix) Fix Cowork VM: "Failed to create bridge sockets after 5 attempts" on every session start [2 comments, 3 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#49385Fetched 2026-04-17 08:42:38
View on GitHub
Comments
2
Participants
3
Timeline
9
Reactions
0
Timeline (top)
labeled ×4commented ×2cross-referenced ×2closed ×1

Error Message

[Spawn:vm] id=<uuid> Spawn succeeded in 58ms [vm-stderr <uuid>] Error: Failed to create bridge sockets after 5 attempts [Process:<uuid>] Exited, code=1, signal=null, duration=~1000ms, oom=false

Root Cause

Root cause traced in the guest claude binary

In the sandbox-runtime function that initializes the Linux HTTP/SOCKS bridges (bundled as u57 in the minified output), two socat processes are spawned:

Code Example

[Spawn:vm] id=<uuid> Spawn succeeded in 58ms
[vm-stderr <uuid>] Error: Failed to create bridge sockets after 5 attempts
[Process:<uuid>] Exited, code=1, signal=null, duration=~1000ms, oom=false

---

socat UNIX-LISTEN:/tmp/claude-http-<hex>.sock,fork,reuseaddr  TCP:localhost:<httpPort>,...
socat UNIX-LISTEN:/tmp/claude-socks-<hex>.sock,fork,reuseaddr TCP:localhost:<socksPort>,...

---

throw Error(`Failed to create bridge sockets after ${j} attempts`)
RAW_BUFFERClick to expand / collapse

Environment

  • Claude Desktop: 1.3036.0
  • Claude Code SDK (in VM): 2.1.111
  • macOS: 26.5 beta (build 25F5042g)
  • Apple Silicon M3 Max (arm64)

Symptoms

Every Cowork task fails immediately with "Claude Code process exited with code 1". 100% reproducible across: app restart (3x), full VM reboot, complete sessiondata.img reset, fresh session creation, and multiple different tasks (including a brand new session with only "hello" as input).

Logs from ~/Library/Logs/Claude/cowork_vm_node.log

[Spawn:vm] id=<uuid> Spawn succeeded in 58ms
[vm-stderr <uuid>] Error: Failed to create bridge sockets after 5 attempts
[Process:<uuid>] Exited, code=1, signal=null, duration=~1000ms, oom=false

The VM itself boots and reaches guest_ready cleanly ([VM:start] Startup complete, total time: 6154ms, API reachability: REACHABLE, SDK install succeeds). The failure is exclusively at the per-session claude spawn, ~1s after process start.

Root cause traced in the guest claude binary

In the sandbox-runtime function that initializes the Linux HTTP/SOCKS bridges (bundled as u57 in the minified output), two socat processes are spawned:

socat UNIX-LISTEN:/tmp/claude-http-<hex>.sock,fork,reuseaddr  TCP:localhost:<httpPort>,...
socat UNIX-LISTEN:/tmp/claude-socks-<hex>.sock,fork,reuseaddr TCP:localhost:<socksPort>,...

Both spawn calls succeed (no "Linux bridge process died unexpectedly" in logs). The function then polls fs.existsSync on both socket paths for 5 attempts with incremental backoff (0, 100, 200, 300, 400 ms). On each failed iteration the sockets don't appear, and on the 5th the function throws:

throw Error(`Failed to create bridge sockets after ${j} attempts`)

Suspected cause

Elsewhere in the same binary the seccomp-filter module states:

[SeccompFilter] The current seccomp filter only blocks socket(AF_UNIX, ...)

So the sandbox is designed to deny AF_UNIX socket creation to the sandboxed child — but the two socat bridge processes (spawned as children of the parent process to prepare the sandbox) appear to inherit that filter in this environment. That would explain: socat alive, no crash, but no .sock file ever created (the bind() would ENOSYS/EACCES silently for a plain UNIX-LISTEN).

May be macOS-26.5-beta-specific: Virtualization.framework behavior around process-creation / filter inheritance has changed across beta seeds, which could break an assumption the sandbox-runtime makes on stable macOS.

What I tried (none worked)

  • Quit Claude.app + relaunch (3×)
  • Full VM reboot (VM bundle rebuild, fresh guest_ready)
  • Rename ~/Library/Application Support/Claude/vm_bundles/claudevm.bundle/sessiondata.img aside and let VM regenerate a fresh empty one
  • Brand-new Cowork session with only "hello" as input
  • Verified no stale sockets on host side in the session's shim-perm/{requests,responses} dirs

Reproducibility

100% on this machine. Happy to provide fuller log excerpts or run diagnostics — just let me know.

extent analysis

TL;DR

The most likely fix is to modify the seccomp filter to allow AF_UNIX socket creation for the sandboxed child processes.

Guidance

  • Investigate the seccomp filter configuration to understand why it's blocking AF_UNIX socket creation and consider updating it to allow this for the socat bridge processes.
  • Verify that the socat processes are indeed being spawned as children of the parent process and inheriting the seccomp filter.
  • Check the Virtualization.framework documentation for any changes in process creation and filter inheritance behavior in macOS 26.5 beta that may be causing this issue.
  • Consider testing on a stable version of macOS to determine if the issue is specific to the beta version.

Example

No code snippet is provided as the issue is related to the seccomp filter configuration and Virtualization.framework behavior, which requires further investigation.

Notes

The issue may be specific to macOS 26.5 beta, and testing on a stable version may help determine if it's a beta-specific problem. The seccomp filter configuration and Virtualization.framework behavior should be carefully reviewed to understand the root cause of the issue.

Recommendation

Apply a workaround by modifying the seccomp filter to allow AF_UNIX socket creation for the sandboxed child processes, as this is the most likely cause of the issue. This will require further investigation and testing to ensure that the workaround does not introduce any security vulnerabilities.

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