docs(runbook): document persistent xhost grant for vmware GUI

§4.7 now explains the grant is per-session and points to setup Step 8 /
the standalone install-vmware-gui-access.sh, keeping the manual one-off
xhost command as a fallback.
This commit is contained in:
2026-06-08 21:11:07 +02:00
parent 3f43b1ca12
commit cda4276d9e
+19 -6
View File
@@ -36,14 +36,14 @@ ci validate host # smoke test the alias
The script defines two helpers:
| Helper | Runs as | Use for |
|---------|---------------|---------|
| ------- | ------------------ | --------------------------------------- |
| `ci` | `ci-runner` (sudo) | everything (writes keyring, starts VMs) |
| `ci-me` | current user | read-only checks where sudo is noise |
### 0.3 Live environment
| Thing | Value |
|-------|-------|
| ------------------ | ---------------------------------------------------------------------------------- |
| Service user | `ci-runner` · Prod venv `/opt/ci/venv/bin/python` |
| Config | `/var/lib/ci/config.toml` |
| Linux template | `/var/lib/ci/templates/LinuxBuild2404/LinuxBuild2404.vmx` (snap `BaseClean-Linux`) |
@@ -56,7 +56,7 @@ The script defines two helpers:
## 1. Quick reference — every command
| Command | Does | Section |
|---------|------|---------|
| ----------------------------- | --------------------------------------------- | ------- |
| `ci validate host` | host prerequisites check (no VM) | §2 |
| `ci validate guest --host IP` | probe a running guest's transport | §2 |
| `ci monitor disk` | free-space alert | §2 |
@@ -232,8 +232,21 @@ inherited `XAUTHORITY` (the desktop user's `~/.Xauthority`) is unreadable by
ci-runner, so `vmware` drops it and relies on the xhost grant — which is normally
already present (`xhost` lists `SI:localuser:ci-runner`).
**Only if you get `cannot open X display`**: the grant is missing. Add it from
the logged-in desktop user (not ci-runner):
The xhost grant is **per-session**: it is wiped on logout / X restart. To make
it persistent, `setup-host-linux.sh` (Step 8) installs an XDG autostart entry in
the desktop user's home that re-applies the grant at every graphical login. You
can (re)run it standalone:
```bash
# As root (or via sudo); --desktop-user defaults to $SUDO_USER
sudo CI_RUN_USER=ci-runner bash scripts/install-vmware-gui-access.sh --desktop-user simone
# Remove the grant + autostart entry:
sudo bash scripts/install-vmware-gui-access.sh --desktop-user simone --uninstall
```
This applies the grant immediately (if a display is reachable) and writes
`~simone/.config/autostart/ci-runner-xhost.desktop` for future logins.
**One-off, without the script**: add the grant from the logged-in desktop user
(not ci-runner):
```bash
xhost +SI:localuser:ci-runner
```
@@ -342,7 +355,7 @@ Rollback: `sudo ./setup-host-linux.sh --with-pwsh` reinstalls pwsh; the original
## 9. Troubleshooting quick map
| Symptom | Cause | Fix |
|---------|-------|-----|
| -------------------------------- | ------------------------------------- | ----------------------------------------------------------------------------------- |
| `No such command 'bench'` | prod venv not refreshed | §0.1 `pip install .` |
| `validate host` keyring `[FAIL]` | credential missing/wrong user | §5 `creds set` |
| `validate guest` connect failure | VM not booted / wrong IP / firewall | confirm VM running + IP |