How do I make virtual desktop sessions persistent when using RealVNC Server's Virtual Mode daemon?

Follow

By default, when a RealVNC Viewer user disconnects from RealVNC Server's Virtual Mode daemon their virtual desktop session is lost. When the RealVNC Viewer user reconnects using the same credentials, a new virtual desktop session is created; their previous session does not persist.

To change this so that virtual desktop sessions persist across disconnections, you need to enable the ConnectToExisting parameter in one of the Virtual Mode daemon's configuration files.

As an example, you can use the file /etc/vnc/config.d/vncserver-virtuald as shown in the below code snippet.

echo 'ConnectToExisting=1' | sudo tee -a /etc/vnc/config.d/vncserver-virtuald
sudo systemctl restart vncserver-virtuald

Virtual desktop sessions will always be lost when the computer running the Virtual Mode daemon is shutdown or rebooted.

Was this article helpful?
5 out of 9 found this helpful

Comments

1 comment
  • If I set up 'ConnectToExisting=1' in the '/etc/vnc/config.d/vncserver-virtuald' file to keep the virtual session persistent on my Raspberry Pi using VNC from Windows, will the session keep running for days, even if I completely close the VNC on Windows, provided the computer running the daemon is not shut down or restarted?

    0
    Comment actions Permalink

Please sign in to leave a comment.