TigerVNC server not installed error with medley -v + on Raspberry Pi
On my Raspberry Pi 400 running 64-bit Raspberry Pi OS (Debian Bookworm 12.7) I used Clang to build Medley X11 from the latest sources. When I launch Medley with the -v + option I get this error (BTW the error has a typo: that that):
pi@raspberrypi:~ $ medley -a -e -n -v +
Error: The -v or --vnc flag was set.
But it appears that that TigerVNC server \(Xvnc\) has not been installed.
Please install the TigerVNC server and try again. On Debian and Ubuntu, use:
"sudo apt install tigervnc-standalone-server". On most other Linux distros, use the
distro's package manager to install the "tigervnc-server" package.
Exiting.
All the required TigerVNC components are installed (installato: installed):
pi@raspberrypi:~ $ apt list tigervnc*
Elencazione... Fatto
tigervnc-common/stable,now 1.12.0+dfsg-8 arm64 [installato, automatico]
tigervnc-common/stable 1.12.0+dfsg-8 armhf
tigervnc-scraping-server/stable 1.12.0+dfsg-8 arm64
tigervnc-scraping-server/stable 1.12.0+dfsg-8 armhf
tigervnc-standalone-server/stable,now 1.12.0+dfsg-8 arm64 [installato]
tigervnc-standalone-server/stable 1.12.0+dfsg-8 armhf
tigervnc-tools/stable,now 1.12.0+dfsg-8 arm64 [installato, automatico]
tigervnc-tools/stable 1.12.0+dfsg-8 armhf
tigervnc-viewer/stable,now 1.12.0+dfsg-8 arm64 [installato]
tigervnc-viewer/stable 1.12.0+dfsg-8 armhf
tigervnc-xorg-extension/stable,now 1.12.0+dfsg-8 arm64 [installato]
tigervnc-xorg-extension/stable 1.12.0+dfsg-8 armhf
pi@raspberrypi:~ $ vnc
vncagent vncpamhelper vncserver-x11
vncconfig vncpasswd vncserver-x11-core
vncfopshelper vncserver vncserver-x11-serviced
vncinitconfig vncserverui vncsession
vnclicense vncserver-virtual vncviewer
vnclicensewiz vncserver-virtuald
However, no Xvnc program is in the executable path.
Are you running X11 or Wayland?
What does which Xvnc return?
How about which Xtigervnc?
How did you install tigervnc - using apt-get or was it already installed as part of the RpiOS?
I'm running Wayland which is now the default on Raspberry Pi OS. To install TigerVNC I used the software manager GUI tool that comes with Pi OS: I just marked the relevant packages and activated the installation.
I was wrong about Xvnc not being in the path, here's the output of which:
pi@raspberrypi:~ $ which Xvnc
/usr/bin/Xvnc
pi@raspberrypi:~ $ which Xtigervnc
/usr/bin/Xtigervnc
pi@raspberrypi:~ $ Xvnc
Xvnc Xvnc-core
medley_vnc.sh calls Xvnc with the -version option which the Pi OS Xvnc doesn't recognize. Executing Xvnc -version yields the error Unrecognized option: -version and outputs a very long notice of which this is the relevant part: xvnc-output.txt
However, Xtigervnc does accept the -version option:
pi@raspberrypi:~ $ Xtigervnc -version
Xvnc TigerVNC 1.12.0 - built 2023-01-06 16:01
Copyright (C) 1999-2021 TigerVNC Team and many others (see README.rst)
See https://www.tigervnc.org for information on TigerVNC.
Underlying X server release 12101006, X.Org
@pamoroso Could you let me know what the following return on your RPi:
which xtigervncviewer
which tigervncviewer
ls -l /etc/alternatives/vncviewer
This is the output of the commands:
pi@raspberrypi:~ $ which xtigervncviewer
/usr/bin/xtigervncviewer
pi@raspberrypi:~ $ which tigervncviewer
pi@raspberrypi:~ $ ls -l /etc/alternatives/vncviewer
lrwxrwxrwx 1 root root 24 6 gen 2023 /etc/alternatives/vncviewer -> /usr/bin/xtigervncviewer
/usr/bin/xtigervncviewer is not a symlink. which tigervncviewer returns nothing.
@pamoroso Thanks. I submitted PR #1842 to fix this. Try it out and see if it works for you.
I applied the patch but this somehow messed with my Medley installation and I can no longer run it. So I need to do some Medley troubleshooting before trying VNC.
In medley/scripts/medley/ I renamed medley.command and medley_vnc.sh, downloaded the versions from the patch, and set the x permission of both scripts. When I ran Medley I got this error:
pi@raspberrypi:~ $ medley -a -e -n -v +
Warning: The -v or --vnc flag was set.
But the vnc option is only available when running on
Windows System for Linux (wsl) on x86_64 machines.
Ignoring the -v or --vnc flag.
Error: only one sysout can be specified. Two or more sysouts were speci
fied
via the -l (--lisp), -f (--full), -a (--apps) flags and/or a sysout file
name
I realized the system still had a .deb Medley package and uninstalled it but now I get this puzzling error when launching Medley (File o directory non esistente: unknown file or directory):
pi@raspberrypi:~/medley/medley/scripts/medley $ medley -a -e -n -v +
bash: /usr/local/bin/medley: File o directory non esistente
This is the content of medley/scripts/medley:
pi@raspberrypi:~/medley/medley/scripts/medley $ ls -l
totale 200
-rwxr-xr-x 1 pi pi 132 29 set 17.19 compile.sh
-rwxr-xr-x 1 pi pi 11850 29 set 17.19 inline.sh
-rwxr-xr-x 1 pi pi 9326 29 set 17.19 medley_args.sh
-rw-r--r-- 1 pi pi 36 9 nov 2023 medley.cmd
-rwxr-xr-x 1 pi pi 45956 1 ott 11.32 medley.command
-rwxr-xr-x 1 pi pi 46076 29 set 17.19 medley.command.old
-rw-r--r-- 1 pi pi 2087 29 set 17.19 medley_configfile.sh
-rwxr-xr-x 1 pi pi 2236 29 set 17.19 medley_geometry.sh
-rw-r--r-- 1 pi pi 1378 29 set 17.19 medley_header.sh
-rwxr-xr-x 1 pi pi 7107 29 set 17.19 medley_main.sh
-rwxr-xr-x 1 pi pi 12003 9 nov 2023 medley.ps1
-rw-r--r-- 1 pi pi 8822 29 set 17.19 medley_run.sh
lrwxrwxrwx 1 pi pi 14 9 nov 2023 medley.sh -> medley.command
-rw-r--r-- 1 pi pi 4012 29 set 17.19 medley_usage.sh
-rw-r--r-- 1 pi pi 4095 29 set 17.19 medley_utils.sh
-rwxr-xr-x 1 pi pi 7045 1 ott 11.32 medley_vnc.sh
-rwxr-xr-x 1 pi pi 7165 29 set 17.19 medley_vnc.sh.old
-rw-r--r-- 1 pi pi 273 29 set 17.19 README
I need to figure out why the scripts are calling /usr/local/bin/medley (no longer installed) and what went wrong.
Try executing medley using ./medley rather than just medley while connected to your top level medley directory, which looks like it is ~/medley/medley. This way any medley commands on your path will be ignored.
Also, not that it matters in this case, but you don't need to copy over medley_vnc.sh. All of the medley_*.sh files are compiled into a single bash script called medley.command (aka medley.sh). The compile.sh script does this compilation.
Okay, I'll try. Do I need to rebuild Medley after saving the two modified files? I just copied the files to the proper directory.
Executing medley using ./medley while connected to the top level directory works and Medley runs. But when I launch it with the VNC option I get this error:
pi@raspberrypi:~/medley/medley $ ./medley -a -e -n -v +
Using DISPLAY=:1
Using VNC_PORT=5901
"/home/pi/medley/medley/../maiko/linux.aarch64/lde" "/home/pi/medley/medley/loadups/apps.sysout" -id "default" -title "Medley Interlisp " -g 1440x900 -sc 1440x900 -noscroll
MEDLEYDIR: "/home/pi/medley/medley"
LOGINDIR: "/home/pi/il"
GREET FILE: "/home/pi/medley/medley/greetfiles/APPS-INIT.LCOM"
VMEM FILE: "/home/pi/il/vmem/lisp.virtualmem"
Unable to open X11 display from DISPLAY
vncconfig: unable to open display ":1"
and this dialog box with an error (connessione rifiutata: connection refused):
VNC is enabled in the system settings and, as far as I know, no firewall is active.
I upgraded my Raspberry Pi 400 to the latest Raspberry OS release and built Medley for X. It runs fine on Wayland, albeit with the known limitations of non-English keyboards. However, when I run Medley under VNC with -v + TigerVNC displays a dialog with the same error I reported a few months ago here with an earlier Raspberry Pi OS release:
Failed to connect to "127.0.0.1:5900":
unable to connect to socket: Connection refused (111)
and Maiko prints this:
Using DISPLAY=:1
Using VNC_PORT=5901
"/home/pi/medley/medley/../maiko/linux.aarch64/lde" "/home/pi/medley/medley/loadups/apps.sysout" -id "default" -title "Medley Interlisp " -g 1440x900 -sc 1440x900 -noscroll
MEDLEYDIR: "/home/pi/medley/medley"
LOGINDIR: "/home/pi/il"
GREET FILE: "/home/pi/medley/medley/greetfiles/APPS-INIT.LCOM"
VMEM FILE: "/home/pi/il/vmem/lisp.virtualmem"
Unable to open X11 display from DISPLAY
vncconfig: unable to open display ":1"
The Raspberry Pi OS 2024-11-19 release I'm using now is based on Debian Bookworm 12.9 and by default runs labwc, a Wayland compositor different from the one in the previous release. I built Maiko and Medley from the head of master (the current code incorporates #1842) and installed the same TigerVNC packages I successfully use with Medley on Linux Mint.
I tried enabling VNC in the system settings but that likely runs a different server and TigerVNC still issues the same error. Unlike a few months ago, now I run the ufw firewall which I'll try to disable to see whether it makes a difference.
Disabling the firewall doesn't help as TigerVNC still displays the error.
This is apparently a (very) longstanding TigerVNC issue as it has been reported since 2015. One of the comments suggests the issue is due to TigerVNC defaulting to -localhost yes and recommends trying -localhost no. I'm not sure this would make a difference as Medley isn't accessing the VNC server remotely, but how do I put together a minimal command line that runs Medley with the appropriate VNC parameters?
127.0.0.1 is localhost, so if it can't connect then nothing is listening on localhost, or access is being blocked.
However the port numbers in your two messages are not the same. VNC displays are generally 5900 + display number.
There is nothing preventing a host-based firewall from blocking ports on 127.0.0.1.
On Linux Mint I run the same ufw firewall and Medley VNC works fine. But on Raspberry Pi OS I get the VNC error even when the firewall is turned off.
As for the port mismatch between the messages, the medley script and the ones it calls make ports match on Linux Mint but apparently not on Raspberry Pi OS.
I would check that things work properly without the scripts first. Start a vncserver on something like display :2 (assuming you don't have any Xvnc serving that already; if so, pick a different display number), and connect to that display with vncviewer. You don't have to get Medley involved to make sure that that works. Once you know that's OK, you can start a medley talking to display :2 and make sure that works - My 2 (euro)cents of advice: avoid the scripts, they're too complicated and error-prone. Do only what you need to do, and put it in ONE single file script that does only what you need to do to get the environment you want running.
Based on the arguments Medley passes to TigerVNC on Linux Mint, on Raspberry Pi OS I played a bit with the VNC server from the command line but didn't go much far:
pi@pi400:~ $ Xvnc :2 -rfbport 5900&
[1] 2439
pi@pi400:~ $ RealVNC(R) Server 7.13.1 (r57) ARMv8-A (Dec 6 2024 19:02:35)
Copyright (C) RealVNC Ltd.
RealVNC and VNC are trademarks of RealVNC Ltd and are protected by trademark
registrations and/or pending trademark applications in the European Union,
United States of America and other jurisdictions.
Protected by UK patent 2481870; US patent 8760366; EU patent 2652951.
See https://www.realvnc.com for information on VNC.
For third party acknowledgements see:
https://www.realvnc.com/docs/7/foss.html
OS: Debian GNU/Linux 12, Linux 6.6.74+rpt, aarch64
<13> 2025-03-15T09:30:59.194Z pi400 Xvnc[2439]: ServerManager: Server started
Underlying X server release 609000, The X.Org Foundation
error opening security policy file /usr/X11R6/lib/X11/xserver/SecurityPolicy
Could not init font path element /usr/X11R6/lib/X11/fonts/misc/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/TTF/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/Type1/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/CID/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/75dpi/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/100dpi/, removing from list!
AUDIT: Sat Mar 15 10:31:00 2025: 2439 Xvnc-core: client 1 rejected from local host
No protocol specified
AUDIT: Sat Mar 15 10:31:00 2025: 2439 Xvnc-core: client 1 rejected from local host
No protocol specified
unable to open display ":2"
AUDIT: Sat Mar 15 10:31:02 2025: 2439 Xvnc-core: client 1 rejected from local host
No protocol specified
AUDIT: Sat Mar 15 10:31:02 2025: 2439 Xvnc-core: client 1 rejected from local host
No protocol specified
[...similar audit messages...]
unable to open display ":2"
Xvnc :2 -rfbport 5900
^CFreeFontPath: FPE "/usr/share/vnc/fonts/" refcount is 2, should be 1; fixing.
<13> 2025-03-15T09:31:28.663Z pi400 Xvnc[2439]: ServerManager: Server stopped
Adding more of the arguments Medley passes didn't help. By the way, the version of TigerVNC that ships with Raspberry Pi OS doesn't recognize the --MaxDisconnectionTime argument Medley uses.
pi@pi400:~ $ Xvnc :2 -rfbport 5900 -SecurityTypes None -NeverShared -DisconnectClients=0
RealVNC(R) Server 7.13.1 (r57) ARMv8-A (Dec 6 2024 19:02:35)
Copyright (C) RealVNC Ltd.
RealVNC and VNC are trademarks of RealVNC Ltd and are protected by trademark
registrations and/or pending trademark applications in the European Union,
United States of America and other jurisdictions.
Protected by UK patent 2481870; US patent 8760366; EU patent 2652951.
See https://www.realvnc.com for information on VNC.
For third party acknowledgements see:
https://www.realvnc.com/docs/7/foss.html
OS: Debian GNU/Linux 12, Linux 6.6.74+rpt, aarch64
<13> 2025-03-15T09:36:21.420Z pi400 Xvnc[2895]: ServerManager: Server started
Underlying X server release 609000, The X.Org Foundation
error opening security policy file /usr/X11R6/lib/X11/xserver/SecurityPolicy
Could not init font path element /usr/X11R6/lib/X11/fonts/misc/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/TTF/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/Type1/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/CID/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/75dpi/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/100dpi/, removing from list!
AUDIT: Sat Mar 15 10:36:22 2025: 2895 Xvnc-core: client 1 rejected from local host
No protocol specified
AUDIT: Sat Mar 15 10:36:22 2025: 2895 Xvnc-core: client 1 rejected from local host
No protocol specified
unable to open display ":2"
AUDIT: Sat Mar 15 10:36:24 2025: 2895 Xvnc-core: client 1 rejected from local host
No protocol specified
AUDIT: Sat Mar 15 10:36:24 2025: 2895 Xvnc-core: client 1 rejected from local host
No protocol specified
unable to open display ":2"
^CFreeFontPath: FPE "/usr/share/vnc/fonts/" refcount is 2, should be 1; fixing.
<13> 2025-03-15T09:36:25.723Z pi400 Xvnc[2895]: ServerManager: Server stopped
Does the TigerVNC installation on RPi come with the "vncserver" executable?
These are the TigerVNC commands available on Raspberry Pi OS:
pi@pi400:~ $ vnc
vncagent vncpamhelper vncserver-x11
vncconfig vncpasswd vncserver-x11-core
vncfopshelper vncserver vncserver-x11-serviced
vncinitconfig vncserverui vncsession
vnclicense vncserver-virtual vncviewer
vnclicensewiz vncserver-virtuald
pi@pi400:~ $ Xvnc
Xvnc Xvnc-core