TigerVNC and RealVNC on Raspberry Pi Bookworm OS

RealVNC on Bookworm OS Title Image

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:

RealVNC on Raspberry Pi Bullseye 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.

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:

TigerVNC with IP address and port number. 192.168.0.171:5901

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:

Raspberry Pi Software Configuration

Then you need to scroll down to Advanced Options, because you need to switch over to X11.

Switch from Wayland 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.

Configuring VNC on Bookworm OS

That will enable RealVNC automatically. And then you’re set:

RealVNC on Bookworm OS

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?

Raspberr Pi 5 Contest

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!

14 Comments

  1. hoke on October 17, 2023 at 8:41 pm

    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?

  2. Joseph Mwema on October 25, 2023 at 8:07 pm

    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!

  3. Detlef Wessel on October 28, 2023 at 4:09 pm

    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.

  4. Mike Gibson on November 1, 2023 at 2:19 pm

    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

    • flaviobor on November 5, 2023 at 11:18 am

      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.

  5. penguin on November 18, 2023 at 12:41 am

    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

  6. Diana on December 3, 2023 at 4:14 pm

    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

    • Adam on December 8, 2023 at 12:54 pm

      Eigentlich habe ich alles ohne KI geschrieben. Was ist das genaue Problem, Diana?

  7. piuser99999 on January 30, 2024 at 1:39 am

    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.

  8. Lluís J. on February 3, 2024 at 2:51 pm

    How to keep tigervncserver autorunning after each reboot?
    Thanks

  9. Tony (aqk) on February 18, 2024 at 5:27 am

    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 ?

  10. Tony (aqk) on February 18, 2024 at 5:38 am

    Wait! – It gets worse!
    I can’t even get a headless session (using PuTTY)
    It appears that SSH is down. Any suggestions? ;-(

  11. Tony (aqk) on February 18, 2024 at 9:38 pm

    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!

  12. Barry-IA on May 20, 2024 at 11:09 pm

    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.

Leave a Comment