termux wayland via vnc

 pkg install sway foot wayvnc labwc


mkdir .config/labwc

wget https://raw.githubusercontent.com/kzwkt/debian-stable/refs/heads/main/.config/labwc/menu.xml

wget https://raw.githubusercontent.com/kzwkt/debian-stable/refs/heads/main/.config/labwc/rc.xml

for labwc 


cat start.sh 

-------------------------------------------------------------------------------------------

export XDG_RUNTIME_DIR=sock

export XDG_SESSION_TYPE=wayland

chmod 700 $XDG_RUNTIME_DIR

export WLR_BACKENDS=headless

#export WLR_RENDERER=pixman

export WLR_LIBINPUT_NO_DEVICES=1

#export LABWC_FALLBACK_OUTPUT=1024x768 

labwc >  labwc.log 2>&1 &

sleep 2

wayvnc -r 0.0.0.0 5900

-------------------------------------------------------------------------------------------

works but is kinda slow 

and gets killed mahybe by phantom process killer

https://github.com/sabamdarif/termux-desktop/blob/main/docs/disable-phantom-process-killing.md

/start.sh 

Warning: ../src/src/ctl-server.c: 837: Deleting stale control socket path "sock/wayvncctl"

Read from remote host 192.168.1.154: Connection reset by peer

Connection to 192.168.1.154 closed.

client_loop: send disconnect: Broken pipe

it might be due to sshd,wayvnc 

cat labwc.log 
00:00:00.035 [ERROR] [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to create gbm device"
00:00:00.035 [ERROR] [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to create gbm device"
00:00:00.035 [ERROR] [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "eglInitialize"
00:00:00.035 [ERROR] [render/egl.c:268] Failed to initialize EGL
00:00:00.035 [ERROR] [render/egl.c:585] Failed to initialize EGL context
00:00:00.035 [ERROR] [render/gles2/renderer.c:499] Could not initialize EGL



for sway 
start waync inside sway exec

cat swayvnc.conf 
# Disable default safety check for headless/XDG environments
xwayland disable

# Auto-start wayvnc once Sway is initialized
exec wayvnc 0.0.0.0 5900

start sway in start.sh with this
sway -c /tmp/swayvnc.conf