verify: support authenticated headless Linux guest checks #228

Closed
Valdi320 wants to merge 5 commits from upstream-pr/228 into main
Valdi320 commented 2026-11-26 13:24:42 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by Valdi320 on 2026-11-26T13:24:42Z.


Problem

Headless Linux verification with GE-Proton11-14/UMU can time out even when guest receipts are correct because the launcher keeps Wine services alive without an accessible display.

Change

Use a private authenticated Xvfb when a graphical session is absent; restore the host environment and clean up on all exit paths. Probe the display and Xauthority used by the guest. Existing desktop and native paths are preserved.

Validation

RTX 4080, NVIDIA 620.73.04, Linux, GE-Proton11-14, isolated offline prefix:

  • 13/13 real guest gates: CPU routes, D3D12 signatures/GUIDs, queues/tables, 5 presentation modes including 4K, Lanes replay.
  • Python suite: 380 tests (8 skipped), no failures; 13 targeted tests after the follow-up.
  • Lanes cannot test host display lifecycle itself; Python tests cover session preservation, missing Xvfb and cleanup on failure.

Draft: full check against final branch and additional vendor validation remain outstanding.

<!-- greyfinch-sync:brcly/TuxBox:issue:5510849305 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/228). Originally posted by [Valdi320](https://github.com/Valdi320) on 2026-11-26T13:24:42Z. --- ## Problem Headless Linux verification with GE-Proton11-14/UMU can time out even when guest receipts are correct because the launcher keeps Wine services alive without an accessible display. ## Change Use a private authenticated Xvfb when a graphical session is absent; restore the host environment and clean up on all exit paths. Probe the display and Xauthority used by the guest. Existing desktop and native paths are preserved. ## Validation RTX 4080, NVIDIA 620.73.04, Linux, GE-Proton11-14, isolated offline prefix: - 13/13 real guest gates: CPU routes, D3D12 signatures/GUIDs, queues/tables, 5 presentation modes including 4K, Lanes replay. - Python suite: 380 tests (8 skipped), no failures; 13 targeted tests after the follow-up. - Lanes cannot test host display lifecycle itself; Python tests cover session preservation, missing Xvfb and cleanup on failure. Draft: full check against final branch and additional vendor validation remain outstanding.
brcly commented 2026-11-26 15:14:18 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-26T15:14:18Z.


Heads up: testing this at 513f2ffe broke the X display of a running desktop session here, so please don't merge it as it is, and be careful running its tests on a desktop.

Setup: CachyOS, Hyprland with its Xwayland on :0, GE-Proton11-14, branch merged onto current main.

What happened

  • The private server took display :0, which the session was already using. The log shows verify: private headless Xvfb display :0.
  • Afterwards /tmp/.X11-unix/X0 was gone. Only X0_, which Hyprland also creates, was left.
  • New X11 connections then failed: vulkaninfo couldn't connect, and the five guest-present* gates read a white screen (0xffffff), also with main's verify.py. Linking X0 back to X0_ restored it.

Both paths trigger it

  • test_private_cookie_and_environment_cleanup_even_on_error starts a real Xvfb whenever it is installed, so running the Python tests (or tuxbox.py check) is enough.
  • verify with DISPLAY and WAYLAND_DISPLAY unset does the same. Its 9 selected gates passed, but the socket was removed again.

I haven't confirmed why Xvfb -displayfd considers :0 free here.

Suggestions

  • Choose the display number yourself, skipping any with an existing /tmp/.X11-unix/X<n> (or X<n>_) or /tmp/.X<n>-lock, for example starting at a high number, and fail if the server can't take it. private_x_server may be a useful reference.
  • Make the test that starts a real server opt-in, and have it assert that existing sockets are untouched.
<!-- greyfinch-sync:brcly/TuxBox:comment:7195980956 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/228#issuecomment-7195980956). Originally posted by [brcly](https://github.com/brcly) on 2026-11-26T15:14:18Z. --- Heads up: testing this at `513f2ffe` broke the X display of a running desktop session here, so please don't merge it as it is, and be careful running its tests on a desktop. **Setup:** CachyOS, Hyprland with its Xwayland on `:0`, GE-Proton11-14, branch merged onto current `main`. **What happened** - The private server took display `:0`, which the session was already using. The log shows `verify: private headless Xvfb display :0`. - Afterwards `/tmp/.X11-unix/X0` was gone. Only `X0_`, which Hyprland also creates, was left. - New X11 connections then failed: `vulkaninfo` couldn't connect, and the five `guest-present*` gates read a white screen (`0xffffff`), also with `main`'s `verify.py`. Linking `X0` back to `X0_` restored it. **Both paths trigger it** - `test_private_cookie_and_environment_cleanup_even_on_error` starts a real `Xvfb` whenever it is installed, so running the Python tests (or `tuxbox.py check`) is enough. - `verify` with `DISPLAY` and `WAYLAND_DISPLAY` unset does the same. Its 9 selected gates passed, but the socket was removed again. I haven't confirmed why `Xvfb -displayfd` considers `:0` free here. **Suggestions** - Choose the display number yourself, skipping any with an existing `/tmp/.X11-unix/X<n>` (or `X<n>_`) or `/tmp/.X<n>-lock`, for example starting at a high number, and fail if the server can't take it. `private_x_server` may be a useful reference. - Make the test that starts a real server opt-in, and have it assert that existing sockets are untouched.
Valdi320 commented 2026-11-26 16:47:27 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by Valdi320 on 2026-11-26T16:47:27Z.


Thanks for catching this, and sorry for the disruption. Kept the PR draft. Updated head: 6b8c71e3a8.

  • Xvfb now requires explicit TUXBOX_VERIFY_HEADLESS=1, and the live unit test separately requires TUXBOX_TEST_HEADLESS_XVFB=1. Normal unit tests cannot start it.
  • Select an explicit display in :100–:199, checking lock files, pathname sockets (including X_), dangling symlinks, and pathname/abstract Unix sockets from /proc/net/unix. Fail if no verifiably free number, or if the server does not report exactly the requested number. Never fall back to automatic selection.
  • Mock tests exercise occupied paths/aliases/abstract sockets, absent socket table, no available number, wrong receipt and missing opt-in. The opt-in live test checks existing socket/lock identities before, during and after the private server.
  • 16/17 focused tests pass by default (live test skipped); 17/17 with explicit opt-in. All six no-GPU groups passed on current main base 4d3dd26.
  • Real RTX 4080 / GE-Proton11-14: 10/10 selected guest controls pass (signatures, GUIDs, tables, queues, Lanes replay, five present including 4K), explicit :100, all four pre-existing X socket/lock paths unchanged and environment restored. Runtime and Lanes fixture from the same-base build, source equality checked.

This does not reproduce the original Hyprland collision on your machine, and filesystem/socket selection cannot guarantee against every competing non-cooperating server race. The default is now no new server. Please keep this draft until you are satisfied with the fix; no claim of complete cross-desktop or AMD validation.

<!-- greyfinch-sync:brcly/TuxBox:comment:7198098788 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/228#issuecomment-7198098788). Originally posted by [Valdi320](https://github.com/Valdi320) on 2026-11-26T16:47:27Z. --- Thanks for catching this, and sorry for the disruption. Kept the PR draft. Updated head: 6b8c71e3a84600b8a43c32f640628ebc08221063. - Xvfb now requires explicit TUXBOX_VERIFY_HEADLESS=1, and the live unit test separately requires TUXBOX_TEST_HEADLESS_XVFB=1. Normal unit tests cannot start it. - Select an explicit display in :100–:199, checking lock files, pathname sockets (including X<n>_), dangling symlinks, and pathname/abstract Unix sockets from /proc/net/unix. Fail if no verifiably free number, or if the server does not report exactly the requested number. Never fall back to automatic selection. - Mock tests exercise occupied paths/aliases/abstract sockets, absent socket table, no available number, wrong receipt and missing opt-in. The opt-in live test checks existing socket/lock identities before, during and after the private server. - 16/17 focused tests pass by default (live test skipped); 17/17 with explicit opt-in. All six no-GPU groups passed on current main base 4d3dd26. - Real RTX 4080 / GE-Proton11-14: 10/10 selected guest controls pass (signatures, GUIDs, tables, queues, Lanes replay, five present including 4K), explicit :100, all four pre-existing X socket/lock paths unchanged and environment restored. Runtime and Lanes fixture from the same-base build, source equality checked. This does not reproduce the original Hyprland collision on your machine, and filesystem/socket selection cannot guarantee against every competing non-cooperating server race. The default is now no new server. Please keep this draft until you are satisfied with the fix; no claim of complete cross-desktop or AMD validation.
Valdi320 commented 2026-11-26 23:21:23 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by Valdi320 on 2026-11-26T23:21:23Z.


Deferred: the initial head disrupted a desktop session. Later opt-in headless isolation was tested locally, but the maintainer has not revalidated it. Revisit only with independent display-isolation evidence and a clear request. Closing this draft to make the review queue manageable, per the maintainer's request. The branch and history remain intact at 6b8c71e; no branch deleted.

<!-- greyfinch-sync:brcly/TuxBox:comment:7205471753 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/228#issuecomment-7205471753). Originally posted by [Valdi320](https://github.com/Valdi320) on 2026-11-26T23:21:23Z. --- Deferred: the initial head disrupted a desktop session. Later opt-in headless isolation was tested locally, but the maintainer has not revalidated it. Revisit only with independent display-isolation evidence and a clear request. Closing this draft to make the review queue manageable, per the maintainer's request. The branch and history remain intact at `6b8c71e`; no branch deleted.

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!228
No description provided.