fix /desktop: break the VNC password deadlock, drop the vncpasswd dependency

The desktop page has never worked on a fresh install. Two faults, both fatal.

The password could never be created. DesktopView fetches /desktop/vnc-password
before opening the WebSocket, but ensureVncPassword ran only from startSession,
which only the WebSocket triggers — so the endpoint answered "not configured",
the UI stopped, and the socket that would have provisioned it was never opened.
A new vnc:ensure-password sidecar command provisions it directly; the endpoint
asks for it instead of returning 500.

The rfbauth file could never be written either. ensureVncPassword shelled out to
tigervnc's `vncpasswd -f`, which is not installed — and, contrary to the comment
in setup-desktop.sh, is not in tigervnc-common, which ships only tigervncconfig.
The failure was swallowed because only a zero exit wrote the file, so x11vnc got
-rfbauth pointing at nothing. x11vnc writes that format itself with -storepasswd,
so the dependency is gone and a failure now throws.

Verified on the box: the endpoint returns a password, .vnc/{passwd,password} are
written 0600, and the sidecar reports mirroring :0 on 5900 with x11vnc using the
generated rfbauth file.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
brunorezio
2026-07-26 05:15:46 +01:00
co-authored by Claude Opus 5
parent 96dd1bfe9e
commit 7556c9ed00
6 changed files with 73 additions and 22 deletions
+4 -3
View File
@@ -21,11 +21,12 @@ sudo DEBIAN_FRONTEND=noninteractive apt install -y -qq \
ubuntu-desktop \
gdm3 \
x11vnc \
tigervnc-common \
dbus-x11
echo " Done."
# tigervnc-common provides `vncpasswd`, which the VNC sidecar uses to write the .vnc/passwd rfbauth
# file that x11vnc mirrors :0 with (see vnc-manager.ts). x11vnc alone does NOT ship vncpasswd.
# No tigervnc package is needed. The VNC sidecar writes the .vnc/passwd rfbauth file with
# `x11vnc -storepasswd` (see vnc-manager.ts). tigervnc-common was installed here for `vncpasswd`,
# but it does not ship that binary — it only provides tigervncconfig — so the rfbauth file was never
# created and the desktop could not authenticate.
# --- Step 2: Force GDM onto Xorg + enable auto-login (x11vnc cannot mirror Wayland) ---
echo "[2/5] Forcing Xorg session and auto-login in GDM..."