If your goal is to share the local desktop session, just install xRDP and x11vnc (disable the built in vnc via Settings > Sharing > Desktop).
And slightly modify the vnc section like in my /etc/xrdp/xrdp.ini (most importantly, port should be 5900): Homeserver/xrdp.ini at master · zilexa/Homeserver · GitHub
Note this is the default xRDP.ini with just the xVNC section modified and loglevel set to warning instead of debug.
That’s really all I had to do. xRDP is faster than vnc, but to connect to the local desktop session it requires x11vnc.
thanks a lot for the help!
with the script I managed to run the Remote Desktop at least over LAN, if I connect the client directly with the server. Unfortunately not yet over the internet. But anyway, thanks a lot. I am a big step further.
Well, the provided solution works. Even remotely. Just a matter of exposing the service (port forwarding) and deciding on how to handle authorisation and security.
I would simply use Wireguard VPN and nothing else. But xrdp has authentication options.
I also run Guacamole on the same server. It even supports 2FA. But I didn’t expose Guacamole either. Should work via VPN as well.
WireGuard can be 70% faster than OpenVPN, obvious choice if you go that route.
With Guacamole, regardless of where you are and on what device, you can always connect via VNC, SSH or RDP by simply browsing to your Guacamole web UI and connecting to any (other) system with those remote services exposed. No need to install a client on your laptop or whatever you use when remote.