Date
Dec. 21st, 2024
 
2024年 11月 21日

Post: Raspberry Pi RealVNC can not be connected

Raspberry Pi RealVNC can not be connected

Published 15:05 May 01, 2024.

Created by @ezra. Categorized in #UNIX/Linux, and tagged as #UNIX/Linux.

Source format: Markdown

Table of Content

What's wrong

I just reinstalled the bookworm version of Raspberry OS for my 4B model. After enabled the VNC server, I can not connect to the Pi due to this error:

unknown authentication scheme from vnc server 13, 5

How to fix

I'd recommend using RealVNC's VNC Viewer - it's free to use and guaranteed to work with the RealVNC VNC Server.

You can download it here: https://www.realvnc.com/en/connect/download/viewer/.

However, after doing a bit of digging, what has probably happened here is that in VNC Server 6.11.0, RealVNC upgraded the security of how VNC passwords were stored: https://help.realvnc.com/hc/en-us/articles/6661259023389.

Since the Raspberry Pi repository had version 6.10.0 previously and has now jumped to 7.x, this change is only just kicking in.

To add to the above, version 7.0.0 also changed the default encryption level of connections on Raspberry Pi from PreferOn to AlwaysOn, to match the default for VNC Server on other platforms.

This means that after installing 7.x VNC Server and restarting it, the password is upgraded to the new format, stopping connectivity from non-RealVNC VNC Viewers.

To correct this, you will need to change VNC Server's Encryption from AlwaysOn to the previous PreferOn (though if you aren't using a RealVNC VNC Viewer you won't benefit from any encryption anyway), and then reset your VNC Password.

Theres' 2 ways to do this:

GUI way

  • Using the GUI. Open VNC Server's Options, and change the Encryption dropdown to Prefer On or Prefer Off, and click Apply.
  • Next, go to Users & Permissions and click the Password button on the right. Enter your password and make sure to check the "Allow connections from legacy VNC Viewers" checkbox.

00

01

CLI way

Using SSH/command line. Run the below commands:

echo 'Encryption=PreferOn' | sudo tee -a /root/.vnc/config.d/vncserver-x11
sudo vncpasswd -legacy -service
sudo systemctl restart vncserver-x11-serviced
Pinned Message
HOTODOGO
The Founder and CEO of Infeca Technology.
Developer, Designer, Blogger.
Big fan of Apple, Love of colour.
Feel free to contact me.
反曲点科技创始人和首席执行官。
开发、设计与写作皆为所长。
热爱苹果、钟情色彩。
随时恭候 垂询