This is a serious regression when upgrading to TrueNAS Scale cobia 23.10. Upgraders with VMs beware! The old VNC was able to maintain logged in GUI sessions for months, which was crucial in jobs that required a working GUI (think browsers that scrape web pages). The new spice driver does lock up (mostly disconnect mouse and keyboard). After 2-5 mins the spice driver just kills the GUI session, even cron! The workaround that I found so far (worked for 3 weeks so far) is to keep a terminal open with an app running like 'htop' The constant flashing of processes makes spice think that something is happening. Give that a try.
Any luck installing another vnc server/client combo? Maybe RustDesk?
https://github.com/rustdesk/rustdesk/releases
I use X2go under linux.
All my headless machines were ubunut server + x2go.
clients are available for all OS-es (Linux, win, mac)
You only have to have a working ssh connection under.
You can even select, what windows manager to use (LXDE to GNOME).
But you must install the seleted window manager on the server to ba able to use it.
Also, recently I recognised that root login is not always enabled. (I think, it is a ssh setting, not an Yx2go setting)
So for security reasons, create a secondary, sudo user for this prupose.
Also, after a new install on server side the client might be necessary to update too, because at some updates, backward compatibility breaks.
Otherwise I really like that it is working out of the box if properly installed.
The only limitation I encountered is that it is only working on local networks (At least I did not put too much effort trying to solve this . I guess, since it is over ssh, with a fixed IP or dyndns plus port forvarding, it should work)