However, with the new update from Raspberry Pi Bullseye OS to Raspberry Pi Bookworm OS, the VNC setup has changed.
The reason is that Bookworm OS doesn’t use X11 as the window manager anymore, but instead relies on Wayland as the default display server. RealVNC, however, is only optimized for X11.
sudo apt update && sudo apt upgrade
sudo apt install tigervnc-standalone-server
On you’ll then need to edit the configuration file. For this, you can go to:
sudo nano /etc/tigervnc/vncserver-config-mandatory
From there, you need to scroll down until you see “$localhost should the TigerVNC server only listen on localhost incoming VNC connections.” You need to delete “#” before $localhost = “no” so that it looks something like this:
# $localhost should the TigerVNC server only listen on localhost for
# incoming VNC connections
#
# $localhost = "yes";
$localhost = "no";
And then you need to hit ctrl-x
and y
to save it as the vncserver-config-mandatory file.
Then run:
sudo tigervncpasswd
And set the password (it needs to be at least 6 characters). When it asks you if you’d like to enter a view-only password, type n.
Now you’ve set up the configurations for the TigerVNC server.
Now you can run:
tigervncserver
And it’ll ask you for the password and then tell you the server port (typically something like 5901
).
then this is how to connect from client to server
ipserver:port

crontab -e
and added
@reboot tigervncserver :1 -geometry 1280x800
After setting this up, on launch I would get the error "No session for pid xxxx".

to solve this issue:
mv /usr/bin/lxpolkit /usr/bin/lxpolkit.bak
server works, but I am unable to connect to the server using the password I setup. Any ideals?