TigerVNC and RealVNC on Raspberry Pi Bookworm OS
Since the release of Bookworm OS, I’ve seen a number of people struggling to get a VNC server set up on their Raspberry Pi.
So I thought I would take this opportunity to share with you how to get RealVNC installed on yours. We discussed the switch over from RealVNC in our article about Bookworm OS, if you’re interested in getting more details.
Here, I’ll first explain what the issue is and then I’ll give you two options on how to deal with the new setup. One is to install TigerVNC. Two is to revert from Wayland to X11 and then configure RealVNC.
VNC on Bookworm OS
If you’re new to the world of VNC servers and clients, then allow me to briefly explain.
A Virtual Network Computing (VNC) server allows you to remotely access a desktop’s graphical user interface.
While you can use SSH to remotely access the terminal, you can use a VNC server and client (also called a “viewer”) to remotely access the GUI.
So on your Raspberry Pi, you go to Raspberry Pi Configuration and turn on VNC. That gives you the RealVNC server display. Then on your other computer, you download the RealVNC viewer and then you have full control.
Traditionally, on Raspberry Pi Bullseye OS, for example, this looks something like this:
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.
On a deeper level, with the switch to Wayland (using the Wayfire compositor), Bookworm OS now relies on WayVNC. And it isn’t fully compatible with RealVNC (yet).
So that leaves you with a couple different options.
Raspberry Pi currently recommends installing TigerVNC as the server and client. So I’ll show you how to do that first.
Alternatively, though, you could still get RealVNC if you desire. So I’ll explain how to do that as well.
Install TigerVNC
TigerVNC is another popular VNC server and client.
So, on Bookworm OS, just go to the applications menu -> preferences -> raspberry pi configuration -> interfaces and then click VNC so it’s enabled.
VNC is disabled by default, because it presents a security risk.
Now, on Bullseye OS, when you enable VNC a RealVNC symbol pops up on the toolbar. With Bookworm OS, however, nothing pops up on the toolbar.
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).
So now let’s turn to your main computer. You’ll need to have the TigerVNC viewer downloaded on it in order to access the Raspberry Pi’s server.
Open the TigerVNC server and you’ll see the following application:
You need to type in the Raspberry Pi’s IP address followed by the port number, as you can see above. This will open the client and then you’re all set.
You should now be able to remotely access your Bookworm OS desktop.
Install RealVNC
But what if you’re looking to install RealVNC instead?
Well, in that case, you can actually revert your Bookworm OS from Wayland back to X11.
This requires opening a terminal and typing in:
sudo raspi-config
Then the following screen will pop up:
Then you need to scroll down to Advanced Options, because you need to switch over to X11.
And then you’ll need to hit <finish> and reboot your Raspberry Pi.
Now all you need to do is exactly what you do on Bullseye OS: applications menu -> preferences -> raspberry pi configuration -> interfaces and then click VNC.
That will enable RealVNC automatically. And then you’re set:
Now you just need the RealVNC viewer on your main computer and you should have no problem remotely accessing your Raspberry Pi Bookworm OS desktop!
Now if you’re interested in getting your hands on a Raspberry Pi 5, then check out our contest!
Contest & Newsletter
We know how frustrating it is to have to wait until October 23rd for a Raspberry Pi 5.
So we wanted to make it possible for you to play around with one as soon as possible.
So we’ve set up a contest: What’s the craziest thing you can come up with for Raspberry Pi 5?
Provided your idea doesn’t destroy it, you can send us your idea and we’ll enact it on ours. And we’ll write an article about it!
We’ll announce the winner here and on buyzero.de on October 23rd.
The winning idea (determined by us) will win a full Raspberry Pi 5 kit. This includes a 27W USB-C Power Delivery (PD) Power Supply, a Raspberry Pi 5 case, an SD card, and a Raspberry Pi 5. All with free shipping within the EU.
The runner-up will win a Raspberry Pi 5 with free shipping within the EU.
So be sure to send in your ideas. You can go to the following link for more information: WIN A FREE RASPBERRY PI 5!
Conclusion
There are, I should mention, other VNC servers and clients that you could set up.
And, of course, if you don’t need the full desktop, then just going with SSH from a terminal is a much faster and more lightweight option.
What do you use a VNC for? Any specific projects?
Let us know in the comments below!
Installed TigerVNC and can acess it with RealVNC for Android, so far so good, but instead of seeing my actual desktop I see a second one with no windows open. Is there a way to see my primary desktop?
And second I need to start the server after every reboot, is there a way to start it automatically?
That sounds like normal behavior for tigervnc, which is based on tightvnc: a new desktop is created.
I was able to get the default desktop by going to raspi-config, making sure that wayfire (wayland) is selected, and enabling vnc. That started wayvnc, which was included in the recommended software of Bookworm for Pi. To view, I needed to use tigervnc on the client. One weakness is that sound is not transmitted to the client by wayvnc, so if you need that, you need to go with X11 plus realvnc, as described in the article.
Thank you so much.
I was stuck with a Headless Rapsberry Pi 4B for days on end not knowing how to access the GUI!
I had even installed Fedora IoT on it hoping to get to the GUI remotely but that presented me an even more challenging uncharted waters. I ended up reverting to flash my Micro SD with Raspberry Pi Bookworm OS again.
This worked great for me! I wasted days trying to figure out how to get this done. The most important thing to note for anyone using Raspberry Pi OS Bookworm is that Bookworm OS doesn’t use X11 as the default display server, instead it uses Wayland.
I chose to switch to X11 and enable VNC server on my Raspberry Pi from the raspi-config tool then accessed it from my Windows OS with Real VNC Viewer after experimenting and failing with those other VNC applications.
This Blog Post saved the day! Thanks a bunch!
Auch ich habe auf Wayland verzichtet und zu X11 convertiert. Dann war es ein leichtes, über raspi-config realvnc server zu installieren. Beim Server die Authentication auf VNC password geändert und ein PW angelegt. Jetzt kann aber der Viewer keine Verbindung zum Server herstellen und meldet: No configured security type is supported by 3.3 VNC Viewer
Auffällig ist, das der Server Version 7.5.1 hat und der Viewer Version 7.7.0. Es gibt aber kein Update zu 7.7.0 unter Bookworm. Würde mich interessieren, welche Versionen Joseph Mwema bei Server und Viewer benutzt.
TigerVNC does not work for me. I get this lovely message. “An unexpected error occurred when communicating with the server: invalid pixel format. Attempt to reconnect?
I’ve tried setting the “headless resolution” to various settings and that make no difference at all
It happened to me after the second reboot. Now I disabled the VNC on the menu “Rasperry Pi Configuration” and installed Tiger vncserver. Now I connect and see the desktop, I do not see the “current” desktop neither the menù bar.
Still try to see the menù bar.
So, They have removed and wrecked VNC. Forced us to use crappy tiger-whatever and mangled a workflow I have been using for 9 years. Nice work
Dieser Artikel hier ist entweder einfach schlecht von KI erstellt oder so mies übersetzt das es nicht zu Ziel führt, es funktioniert einfach nicht nicht mit realvnc noch mit Tigervnc auf einem frisch installiertem Raspberry
Eigentlich habe ich alles ohne KI geschrieben. Was ist das genaue Problem, Diana?
I needed to use RealVNC because I don’t need to open ports or whatever to access the PI remotely, so I had to go back to X11, I hope everything else works fine. But I’m glad that I found this solution after trying on my own to fix RealVNC, thank you. Thank you.
How to keep tigervncserver autorunning after each reboot?
Thanks
I had TigerVNC client installed on my Win-11 machine, and have just installed TigerVPN server in my RPi.
It worked great! So I stupidly decided to remove the RealVNC from the Pi.
Now when I try to connect to my Pi, I get the following error:
“Failed to connect to 10…..:5901”
“Unable to connect to socket: no connection could be made because target actively refused it (10061)”
Obviously I deleted more than just RealVNC. How can I restore VNC ?
Wait! – It gets worse!
I can’t even get a headless session (using PuTTY)
It appears that SSH is down. Any suggestions? ;-(
Please ignore my previous plea for help.
The TigerVNC as well as SSH seems to be running OK again, after I fiddled around with security options and Raspi-config, as well as a couple of reboots.
But then, you KNEW I would eventually get it going, right? 😉
Don’t ask me what the problem was- I have no idea, except that I will not attempt to delete RealVNC again!
Probably a hare on the off-topic side of things but for those running their Pi’s headless and Wayland (vs. X11) I found I needed a Dummy Monitor (HDMI version) to remotely view the Desktop. Remember to also purchase a short micro-HDMI to HDMI adapter! Here TigerVNC worked fine once I added the Dummy Monitor.