Remote kiosk debugging
Start the X server only from its intended local console session. After that session is running, an SSH session for the same user can attach an application to the existing display by setting the appropriate display and user runtime environment.
export DISPLAY=:0
export XAUTHORITY=/home/app/.Xauthority
export XDG_RUNTIME_DIR=/run/user/$(id -u app)This is a debugging workflow, not a mechanism for starting an X
server over SSH. Check the target application’s display and
authentication expectations before attaching it. The complete
local-console STARTX policy belongs on the STARTX runner page; do not replace
it with startx from an SSH session.