bootstrap
Adom Hydrogen (platform base)
Public Made by Adomby adom
Layer Hydrogen's workspace onto a standard Adom workstation.
← Commit history
skills/hydrogen-wslg/SKILL.mddeleted−73@@ -1,73 +0,0 @@-name: hydrogen-wslg-description: WSLg (Linux GUI apps from the Hydrogen workspace) is OFF by default. How to check it, turn it on or off from inside the workspace through Hydrogen's control API, apply it with a workspace restart, and what to do about the "RemoteApp security warning" dialog. Trigger words - wslg, linux gui app, gui app from wsl, x11, wayland, display not set, cannot open display, guiApplications, turn on wslg, enable gui apps, remoteapp security warning, unknown publisher dummy-entry.--# WSLg in the Hydrogen workspace--## What it is and why it is off--WSLg lets a Linux GUI program running in the workspace draw a window on the Windows-desktop. Under the hood it is a Remote Desktop session: Windows runs `msrdc.exe` against-the WSL virtual machine every time the VM starts.--The Hydrogen workspace is headless: the editor is code-server, served to Hydrogen's own-window. WSLg therefore buys nothing by default and costs a RemoteApp session, a `msrdc`-process and memory per VM start, and on WSL versions before 2.7 an unsigned-RemoteApp-warning dialog on every start. So Hydrogen's setup writes this into the user's-`%USERPROFILE%\.wslconfig` (only if the user had not set it themselves):--```-[wsl2]-guiApplications=false-```--Symptoms of it being off: `DISPLAY` and `WAYLAND_DISPLAY` are unset, GUI programs fail-with "cannot open display", and there is no `/mnt/wslg`.--## Check, enable, disable (from inside the workspace)--The control API is on the Windows host; mirrored networking shares loopback, and the-live URL is in `~/.adom/hydrogen-control-url` (also `$ADOM_HD_CONTROL_URL`). Never-hardcode the port, it can move between launches.--```bash-C=$(cat ~/.adom/hydrogen-control-url)-curl -s "$C/wsl/gui" # {"ok":true,"enabled":false,"configured":"false",...}-curl -s -X POST "$C/wsl/gui" -H 'content-type: application/json' -d '{"enabled":true}'-curl -s -X POST "$C/container-restart" -d '{}' # applies it: restarts the WSL VM (VS Code reconnects in ~10s)-```--Disable is the same POST with `{"enabled":false}` followed by the restart. The POST only-edits `.wslconfig` (merge-safe, other settings untouched); the restart is what makes WSL-re-read it. Tell the user before restarting: every open terminal in the workspace ends.--After enabling and restarting, verify from a fresh shell: `echo $DISPLAY` should print-`:0` and `/mnt/wslg` should exist.--## The "RemoteApp security warning" dialog--If enabling WSLg makes Windows show "The publisher of this RemoteApp program can't be-identified ... Path: dummy-entry ... Remote computer: <GUID>", that is WSLg's own session-on a WSL version older than 2.7 (seen on 2.6.1). The GUID is the WSL VM and changes on-every start, so the dialog's "Don't ask me again" can never stick. The fix is updating-WSL on the Windows side; 2.7 and later drive WSLg silently.--**This shows a Windows UAC (admin) prompt.** Hydrogen never asks a user for UAC on its-own, and neither may you without warning: tell the user first ("Windows will ask for-admin approval to update WSL; nothing restarts now"), send them an Adom Bridge toast so-the prompt has context, and only then run it:--```bash-/mnt/c/Windows/System32/wsl.exe --update # via WSL interop, from inside the workspace-/mnt/c/Windows/System32/wsl.exe --version-```--If the update reports exit code 1618 (another installation in progress), Windows-Installer is busy with something else (often a Windows Update); wait and retry. The new-version takes effect at the next VM restart.--## Related--- [hydrogen-networking](../hydrogen-networking/SKILL.md): mirrored networking, the control port-- [hydrogen-workspace-lifecycle](../hydrogen-workspace-lifecycle/SKILL.md): restart semantics