Unable to connect to server

284 views
Skip to first unread message

kaplan71

unread,
Apr 28, 2022, 5:03:53 PM4/28/22
to noVNC
Hello. 

I have a Raspberry Pi 4 appliance running the VNC and SSH servers. I have confirmed that I can connect to both using a VNC client to the former, and puTTY application for the latter. Both are enabled on the appliance.

The VNC server is configured with the Encryption set to 'Prefer Off', and Authentiaction set to 'VNC Password' settings. 

I completed the installation of the noVNC application onto the appliance using Github, and I have launched the application using the command syntax:

/noVNC/utils/novnc_proxy --vnc localhost:5901

The service starts, and the Navigate to URL message appears with the full text to enter the browser. The text is the following:


I replaced the 'raspberrypi' portions with the ip address of the appliance, and the noVNC page appears on-screen. However, every time that I click on the Connect button, a red bar appears at the top indicating a 'Failed to connect to server' message. I have tried connecting using the Chrome, Edge, and Firefox browsers without success. 

How can I troubleshoot, and resolve this issue? 

Ron Trial

unread,
Jan 14, 2025, 9:59:04 AMJan 14
to noVNC
I also am having this same issue on a Raspberry Pi.  Is there anything that I can try?

Martine & Philippe vont à la mer Martineke

unread,
Jan 14, 2025, 10:46:37 AMJan 14
to noVNC
if it is a recent rpi, the vnc server is wayvnc which listens in 5900

Cary Lewis

unread,
Jan 14, 2025, 10:47:54 AMJan 14
to no...@googlegroups.com
Can you connect to port 5901 via vnc viewer?

--
You received this message because you are subscribed to the Google Groups "noVNC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to novnc+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/novnc/01b53cd5-13be-4ea3-967d-80c2f66d1113n%40googlegroups.com.

Ron Trial

unread,
Jan 14, 2025, 5:29:41 PMJan 14
to noVNC
It is a Pi 4 running bookmark.  I thought it was running RealVNC server as well as RPi Connect.  I appears to be using WayVNC.  I can access it with RPi Connect as well as RealVNC viewer and UltraVNC viewer.  

ps -ax | grep vnc
    686 ?        Ss     0:00 bash /usr/local/noVNC/utils/novnc_proxy
 748793 ?        SLsl   0:12 /usr/bin/wayvnc --config /etc/rpi-connect/wayvnc.config --render-cursor --unix-socket --socket=/run/user/1000/rpi-connect-wayvnc-ctl.sock /run/user/1000/rpi-connect-wayvnc.sock
 748803 ?        Ssl    0:47 /usr/bin/rpi-connectd -socket /run/user/1000/rpi-connect-wayvnc.sock
 748918 ?        Ss     0:00 /bin/sh /usr/sbin/wayvnc-run.sh
 748937 ?        SLl    0:03 wayvnc --render-cursor --detached --gpu --config /etc/wayvnc/config --socket /tmp/wayvnc/wayvncctl.sock
 748951 ?        Ss     0:00 python /usr/sbin/wayvnc-control.py
 749519 pts/0    S+     0:00 grep --color=auto vnc

novnc - Version: 1:1.3.0-1
websockify - Version: 0.10.0+dfsg1-4+b1
wayvnc - Version: 0.9.0~dev-1+rpt2

pi@raspberrypi:/usr/local/noVNC/utils $ ./novnc_proxy --vnc localhost:5901 --listen localhost:6081
Warning: could not find self.pem
Using local websockify at /usr/local/noVNC/utils/websockify/run
Starting webserver and WebSockets proxy on port localhost:6081
WebSocket server settings:
  - Listen on localhost:6081
  - Web server. Web root: /usr/local/noVNC
  - No SSL/TLS support (no cert file)
  - proxying from localhost:6081 to localhost:5901


Navigate to this URL:

    http://raspberrypi:localhost:6081/vnc.html?host=raspberrypi&port=localhost:6081

Network connections are:
pi@raspberrypi:~ $ sudo netstat -ltnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1624250/sshd: /usr/
tcp        0      0 127.0.0.1:6081          0.0.0.0:*               LISTEN      749418/python3      
tcp        0      0 0.0.0.0:6080            0.0.0.0:*               LISTEN      727/python3        
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      746230/cupsd        
tcp6       0      0 :::22                   :::*                    LISTEN      1624250/sshd: /usr/
tcp6       0      0 ::1:631                 :::*                    LISTEN      746230/cupsd        
tcp6       0      0 :::5900                 :::*                    LISTEN      748937/wayvnc



This does not allow me to get in.  If I try to go to the IPaddress:6080, I get the VNC Connect screen which then gives me a "Failed to connect to server" reply.
If I try to go to the IPaddress:6081, It comes back with "This site cannot be reached".
  

Martine & Philippe vont à la mer Martineke

unread,
Jan 15, 2025, 1:23:13 AMJan 15
to noVNC
./utils/novnc_proxy --vnc localhost:5900

5900 with wayvnc not 5901.

Ron Trial

unread,
Jan 15, 2025, 3:46:02 PMJan 15
to noVNC
I have removed WayVNC and am now running with RealVNC.

pi@raspberrypi:/usr/local/noVNC/utils $ ps -ax | grep vnc
    685 ?        Ss     0:00 bash /usr/local/noVNC/utils/novnc_proxy
   1059 ?        Ssl    0:02 /usr/bin/rpi-connectd -socket /run/user/1000/rpi-connect-wayvnc.sock
   2276 ?        Ss     0:00 /usr/bin/vncserver-x11-serviced -fg
   2278 ?        S      0:14 /usr/bin/vncserver-x11-core -service
   2286 ?        S      0:01 /usr/bin/vncagent service 0
   2289 ?        S      0:00 /usr/bin/vncserverui service 0
   2297 ?        S      0:00 /usr/bin/vncserverui -statusicon 0
   2642 pts/1    S+     0:00 grep --color=auto vnc


5900 does not seem to work:

i@raspberrypi:/usr/local/noVNC/utils $ ./novnc_proxy --vnc localhost:5900 --listen localhost:6080

Warning: could not find self.pem
Using local websockify at /usr/local/noVNC/utils/websockify/run
Starting webserver and WebSockets proxy on port localhost:6080
WebSocket server settings:
  - Listen on localhost:6080

  - Web server. Web root: /usr/local/noVNC
  - No SSL/TLS support (no cert file)
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/local/noVNC/utils/websockify/websockify/__main__.py", line 4, in <module>
    websockify.websocketproxy.websockify_init()
  File "/usr/local/noVNC/utils/websockify/websockify/websocketproxy.py", line 696, in websockify_init
    server.start_server()
  File "/usr/local/noVNC/utils/websockify/websockify/websockifyserver.py", line 704, in start_server
    lsock = self.socket(self.listen_host, self.listen_port, False,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/noVNC/utils/websockify/websockify/websockifyserver.py", line 470, in socket
    sock.bind(addrs[0][4])
OSError: [Errno 98] Address already in use
Failed to start WebSockets proxy

5901 does seem to work: 

pi@raspberrypi:/usr/local/noVNC/utils $ ./novnc_proxy --vnc localhost:5901 --listen localhost:6081
Warning: could not find self.pem
Using local websockify at /usr/local/noVNC/utils/websockify/run
Starting webserver and WebSockets proxy on port localhost:6081
WebSocket server settings:
  - Listen on localhost:6081
  - Web server. Web root: /usr/local/noVNC
  - No SSL/TLS support (no cert file)
  - proxying from localhost:6081 to localhost:5901


Navigate to this URL:

    http://raspberrypi:localhost:6081/vnc.html?host=raspberrypi&port=localhost:6081

Press Ctrl-C to exit

But I still get a message that says "This site cannot be reached".

Martine & Philippe vont à la mer Martineke

unread,
Jan 15, 2025, 4:35:13 PMJan 15
to no...@googlegroups.com

unless I'm mistaken:
real vnc server does not work under wayland, that's why wayvnc has been implemented since the appearance of bookworm.
if you want to work with realvnc server anyway you also have to leave wayland for the previous user interface.
but all this seems complicated to me while you had everything at hand to succeed: wayland, wayvnc which listens in 5900 and novnc which can query in 5900.
you will then have to adjust the encryption level of wayvnc which is not supported by novnc.


Ron Trial

unread,
Jan 15, 2025, 4:44:23 PMJan 15
to noVNC
Thank you for your patience with me.  I can go back to Wayland/WayVNC.  I am not sure what or how I might need to do to adjust the WayVNC encryption level?

Martine & Philippe vont à la mer Martineke

unread,
Jan 15, 2025, 5:39:04 PMJan 15
to no...@googlegroups.com

Ron Trial

unread,
Jan 15, 2025, 7:27:54 PMJan 15
to noVNC
Thank you for that.  I have been able to get access with multiple VNC viewers (see above) using WayVNC.  That has not been my issue.  I am trying to get remote access from other devices using NoVNC.  This is not address in the link you have posted.

Martine & Philippe vont à la mer Martineke

unread,
Jan 16, 2025, 2:35:11 AMJan 16
to no...@googlegroups.com

Hello
Look at the wayvnc configuration file.
You will see how to control encryption level.


Ron Trial

unread,
Jan 16, 2025, 12:07:59 PMJan 16
to noVNC
Thank you very much for pointing me there again.  Once I figured out that all I needed to do is remove the "enable_auth=true" line from the config file, it works!!!  Now all I need to do is make it persistent after the Pi boots.  That should be easy.    

I appreciate your persistence with helping me.  I have been struggling with this for literally months now!

Ron Trial

unread,
Jan 17, 2025, 11:20:02 AMJan 17
to noVNC
Even though I am now able to remotely access the Pi with NoVNC, unfortunately, it seems to be unsecured and I get the attached messages from RealVNC and UltraVNC viewers.
I am not concerned about encryption, but none of the viewers prompt for credentials any longer.  This is not acceptable for any device on my network.  Is there some way to require at least password verification without enable_auto=true?  

Screenshot 2025-01-17 111034.jpg
Screenshot 2025-01-17 111030.png
Reply all
Reply to author
Forward
0 new messages