Skip to content

Instantly share code, notes, and snippets.

@rampfox
Created June 1, 2024 16:24
Show Gist options
  • Save rampfox/19aff48300427fe4d6bee9f72a5b2fc7 to your computer and use it in GitHub Desktop.
Save rampfox/19aff48300427fe4d6bee9f72a5b2fc7 to your computer and use it in GitHub Desktop.
Install-and-Auto-Start-TigerVNC-in-Raspberry-pi-bookworm

How to install VNC on Bookworm OS

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.

install TigerVNC

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";
looks something like this (pict)

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


Autostart

crontab -e

and added

@reboot tigervncserver :1 -geometry 1280x800
looks something like this (pict)

After setting this up, on launch I would get the error "No session for pid xxxx".

drawing

to solve this issue:

mv /usr/bin/lxpolkit /usr/bin/lxpolkit.bak

source

picockpit

meefik/linuxdeploy#978 (comment)

ghost/No session for pid xxxx#3 (comment)

@snoopdujour
Copy link

server works, but I am unable to connect to the server using the password I setup. Any ideals?

@rampfox
Copy link
Author

rampfox commented Jan 14, 2025

server works, but I am unable to connect to the server using the password I setup. Any ideals?

hi, I've found another alternative to vnc (sharing screen), it's called raspberry pi connect

here it is the documentation connect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment