launcher: keep the Wine server bind out where namespaces cannot nest #551

Closed
NickStallman wants to merge 1 commit from upstream-pr/551 into main
NickStallman commented 2026-11-29 22:06:33 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T22:06:33Z.


Since #502, ProjectScarlett doesn't start on Ubuntu 26.04 with its default AppArmor profiles and a tmpfs /tmp: the launch ends with unshare: unshare failed: Operation not permitted, after 0.3 s.

Cause. #502 wraps the launch in bwrap. Ubuntu's bwrap-userns-restrict profile lets bwrap start, but what runs inside it has no capabilities in a new user namespace (the kernel log says apparmor="DENIED" ... profile="unpriv_bwrap" ... capname="sys_admin"). Both the offline launch's unshare and the container Proton starts (srt-bwrap) need that. Putting unshare outside and bwrap inside doesn't help: srt-bwrap is still refused, so I didn't reorder them.

Change. The probe now makes a namespace inside the wrapper. If that fails, the launch stays as it was before #502, with the existing message about tmpfs. Systems where namespaces nest keep the bind. The offline isolation isn't touched.

Tested

  • A new test in tests/test_host.py that fails without the change; the other host tests pass.
  • python tuxbox.py check --no-gpu: passed.
  • On this system (kernel 7.0, bubblewrap 0.11.1, /tmp on tmpfs): the old probe passes, then the launch fails; the new one keeps the launch and the game starts offline. ProjectScarlett started on an RTX 5090 (10de:2b85, 620.70.10, GE-Proton11-14) with this change (an integration build on 007b982d, with our diagnostics), then crashed in the title's start-up code after 80 s; that crash is main's own, since #527 (#554, with a draft fix in #557). The launch itself is what this fixes.

Not run: a system where the bind is used (namespaces that nest), AMD, GPU checks (this is launcher code). The tmpfs problem of #419 stays open on systems like this one: a bind made by unshare --mount instead would avoid the profile, but I haven't built it.

cc @smith-3

  • Full python tuxbox.py check of 7f4fdbb6 (rebased onto e5d2e913; no change to the patch): RTX 5090 (10de:2b85, 620.70.10) 200 pass, 0 fail; AMD iGPU (1002:13c0, RADV) 199 pass, 0 fail. GE-Proton11-14.

Evidence: TuxBox check of 7f4fdbb68f, no uncommitted changes, GPU 10de:2b85: 16 passed, 0 failed, 0 not run
Evidence: TuxBox check of 7f4fdbb68f, no uncommitted changes, GPU 1002:13c0: 16 passed, 0 failed, 0 not run

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:issue:5555640087 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/551). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T22:06:33Z. --- Since #502, ProjectScarlett doesn't start on Ubuntu 26.04 with its default AppArmor profiles and a tmpfs `/tmp`: the launch ends with `unshare: unshare failed: Operation not permitted`, after 0.3 s. **Cause.** #502 wraps the launch in `bwrap`. Ubuntu's `bwrap-userns-restrict` profile lets bwrap start, but what runs inside it has no capabilities in a new user namespace (the kernel log says `apparmor="DENIED" ... profile="unpriv_bwrap" ... capname="sys_admin"`). Both the offline launch's `unshare` and the container Proton starts (`srt-bwrap`) need that. Putting `unshare` outside and bwrap inside doesn't help: `srt-bwrap` is still refused, so I didn't reorder them. **Change.** The probe now makes a namespace inside the wrapper. If that fails, the launch stays as it was before #502, with the existing message about tmpfs. Systems where namespaces nest keep the bind. The offline isolation isn't touched. ## Tested - A new test in `tests/test_host.py` that fails without the change; the other host tests pass. - `python tuxbox.py check --no-gpu`: passed. - On this system (kernel 7.0, bubblewrap 0.11.1, `/tmp` on tmpfs): the old probe passes, then the launch fails; the new one keeps the launch and the game starts offline. ProjectScarlett started on an RTX 5090 (`10de:2b85`, 620.70.10, GE-Proton11-14) with this change (an integration build on 007b982d, with our diagnostics), then crashed in the title's start-up code after 80 s; that crash is main's own, since #527 (#554, with a draft fix in #557). The launch itself is what this fixes. **Not run:** a system where the bind is used (namespaces that nest), AMD, GPU checks (this is launcher code). The tmpfs problem of #419 stays open on systems like this one: a bind made by `unshare --mount` instead would avoid the profile, but I haven't built it. cc @smith-3 - Full `python tuxbox.py check` of 7f4fdbb6 (rebased onto e5d2e913; no change to the patch): RTX 5090 (`10de:2b85`, 620.70.10) 200 pass, 0 fail; AMD iGPU (`1002:13c0`, RADV) 199 pass, 0 fail. GE-Proton11-14. Evidence: TuxBox check of 7f4fdbb68ffc, no uncommitted changes, GPU 10de:2b85: 16 passed, 0 failed, 0 not run Evidence: TuxBox check of 7f4fdbb68ffc, no uncommitted changes, GPU 1002:13c0: 16 passed, 0 failed, 0 not run 🤖 Generated with [Claude Code](https://claude.com/claude-code)
brcly commented 2026-11-30 09:26:34 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T09:26:34Z.


Merged into main as af076987 (squashed and credited to you), thanks!

I covered the case you couldn't: CachyOS with /tmp on tmpfs, where namespaces nest. Both the old and the new probe pass here, so the bind is still made, and the host tests pass.

<!-- greyfinch-sync:brcly/TuxBox:comment:7274212777 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/551#issuecomment-7274212777). Originally posted by [brcly](https://github.com/brcly) on 2026-11-30T09:26:34Z. --- Merged into main as af076987 (squashed and credited to you), thanks! I covered the case you couldn't: CachyOS with `/tmp` on tmpfs, where namespaces nest. Both the old and the new probe pass here, so the bind is still made, and the host tests pass.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
brcly/TuxBox!551
No description provided.