I’m having some issues with using realvnc as a remote display.
First, I want to be able to use a non-root user with realvnc. If I understand correctly, the service files should be what I edit to enact this change by running under a non-root user. However:
dietpi@TerraPi:~$ ls -la /etc/systemd/system |grep vnc
dietpi@TerraPi:~$ ls /etc/systemd/system
apt-daily-upgrade.service dietpi-cloudshell.service dietpi-postboot.service.d display-manager.service ifupdown-pre.service.d serial-getty@ttyAMA0.service
apt-daily-upgrade.timer dietpi-firstboot.service dietpi-preboot.service getty-static.service multi-user.target.wants serial-getty@ttyS0.service
apt-daily.service dietpi-fs_partition_resize.service dietpi-ramlog.service getty.target.wants network-online.target.wants sysinit.target.wants
apt-daily.timer dietpi-kill_ssh.service dietpi-vpn.service halt.target.wants poweroff.target.wants timers.target.wants
dbus-org.freedesktop.timesync1.service dietpi-postboot.service dietpi-wifi-monitor.service ifup@.service.d reboot.target.wants
dietpi@TerraPi:~$ sudo systemctl status | grep vnc
├─vncserver-x11-serviced.service
│ ├─371 /usr/bin/vncserver-x11-serviced -fg
│ ├─372 /usr/bin/vncserver-x11-core -service
│ ├─527 /usr/bin/vncagent service 0
│ ├─550 /usr/bin/vncserverui service 0
│ └─586 /usr/bin/vncserverui -statusicon 0
│ ├─1068 grep vnc
└─vncserver-virtuald.service
└─370 /usr/bin/vncserver-virtuald -fg
Also when I connected to realvnc as root, at first I got a “cannot connect to display”/“display is unavailable” error message. This was after connecting to a headless install. I then installed a desktop session (lxde if I am not mistaken), reboot, and was then able to connect to a desktop. I thought that realvnc created a virtual session?
dietpi@TerraPi:~$ grep "VNC" /boot/dietpi.txt
# VNC Server
SOFTWARE_VNCSERVER_WIDTH=1920
SOFTWARE_VNCSERVER_HEIGHT=1080
SOFTWARE_VNCSERVER_DEPTH=32
SOFTWARE_VNCSERVER_DISPLAY_INDEX=1
SOFTWARE_VNCSERVER_SHARE_DESKTOP=0