Skip to content

verify: support authenticated headless Linux guest checks - #228

Draft
Valdi320 wants to merge 5 commits into
brcly:mainfrom
Valdi320:work/headless-verify-xvfb-20261126
Draft

Valdi320 wants to merge 5 commits into
brcly:mainfrom
Valdi320:work/headless-verify-xvfb-20261126

Conversation

@Valdi320

Copy link
Copy Markdown
Contributor

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

brcly commented Nov 26, 2026

Copy link
Copy Markdown
Owner

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

Copy link
Copy Markdown
Contributor Author

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

  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants