Having trouble running demo and using it to connect to my VNC Server

686 views
Skip to first unread message

Sander Smith

unread,
Aug 3, 2020, 11:25:10 AM8/3/20
to noVNC
I'm trying to evaluate noVNC to see if it's right for my project. I started by going to the demo page and clicking "Connect" and....  "Failed to connect to server".

A bit confusing. Not sure why this happened, not sure what VNC server it's trying to connect to. I decided to continue on.

I see that the noVNC URL can take parameters, so I try to run it against my own VNC server. My server runs on a Ubuntu box in my house. I use x11vnc (Version x11vnc: 0.9.16 lastmod: 2019-01-05). I'm using the ngrok service to provide a tunnel from my VNC server to a tcp socket that's globally available at 0.tcp.ngrok.io and some seemingly random port, say 12345. I've connected to this socket using a standard VNC client and it all works great.

I then tried to connect using the noVNC demo by going to 


When I do this I get a "Failed to connect to server". However, I do notice that the x11vnc server console seems to move and it added:

03/08/2020 11:18:38 Got connection from client ::1
03/08/2020 11:18:38   other clients:
03/08/2020 11:18:38 Got TLS/SSL WebSockets connection
caught signal: 11
03/08/2020 11:18:38 deleted 47 tile_row polling images.

 --- x11vnc loop: sleeping 2000 ms ---


 --- x11vnc loop: 7 ---

 --- x11vnc loop: waiting for: 3621

03/08/2020 11:18:41 passing arg to libvncserver: -rfbauth
.........


So it seems that some sort of connection is being made, but something went wrong. How do I get this to work?

Samuel Mannehed

unread,
Aug 4, 2020, 2:47:17 AM8/4/20
to Sander Smith, no...@googlegroups.com
Hi Sander,

> I'm trying to evaluate noVNC to see if it's right for my project. I
> started by going to the demo page and clicking "Connect" and....
> "Failed to connect to server".
>
> A bit confusing. Not sure why this happened, not sure what VNC server
> it's trying to connect to. I decided to continue on.

Yeah I agree that it's confusing. There is no VNC server dedicated for
our demo, you're supposed to test it against your own server.

> I see that the noVNC URL can take parameters, so I try to run it
> against my own VNC server. My server runs on a Ubuntu box in my
> house. I use x11vnc (Version x11vnc: 0.9.16 lastmod: 2019-01-05). I'm
> using the ngrok service to provide a tunnel from my VNC server to a
> tcp socket that's globally available at 0.tcp.ngrok.io and some
> seemingly random port, say 12345. I've connected to this socket using
> a standard VNC client and it all works great.
>
> I then tried to connect using the noVNC demo by going to
>
> *https://novnc.com/noVNC/vnc.html?host=0.tcp.ngrok.io&port=12345*
>
> When I do this I get a "Failed to connect to server". However, I do
> notice that the x11vnc server console seems to move and it added:
>
> ...
>
> So it seems that some sort of connection is being made, but something
> went wrong. How do I get this to work?

noVNC can not connect to regular TCP ports, you will need a WebSocket
proxy inbetween. Some VNC servers include such a proxy, but not x11vnc
I think.

You can have a look at our sister project - Websockify, which is a TCP
to WebSocket proxy.

Best regards,
--
Samuel Mannehed Software Development
Cendio AB https://cendio.com
Teknikringen 8 https://twitter.com/ThinLinc
583 30 Linköping https://facebook.com/ThinLinc
Phone: +46 13 214 600

Sander A. Smith

unread,
Aug 4, 2020, 10:33:22 AM8/4/20
to Samuel Mannehed, no...@googlegroups.com
Hey Samuel,

Thanks for your help.

My understanding was that x11vnc was WebSockets-aware. But assuming it's not, I ran another test that was completely local - no tunnels, nothing fancy. This is the simplest configuration that I could make and it still failed. Here's what I did:

I start my VNC server with the command:

x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbport 5900 -shared

I verified that things are working by connecting with a VNC client from another computer on the network. Everything works - no firewall issues, no problems

I then installed noVNC on another computer on the network. I did this with apt install, so I presumably have the latest noVNC, WebSockify and a little web server all packaged up nicely. I go to

http://localhost:6080/vnc.html?host=192.168.1.122&port=5900

and the noVNC interface comes up. However, if I try to connect, it just says "Connecting..." and never moves on.

In the x11vnc console it says:

04/08/2020 10:20:32 Got connection from client 192.168.1.131
04/08/2020 10:20:32   other clients:
04/08/2020 10:20:32 Got 'ws' WebSockets handshake
04/08/2020 10:20:32   - webSocketsHandshake: using base64 encoding
04/08/2020 10:20:32   - WebSockets client version hybi-13
04/08/2020 10:20:32 incr accepted_client=1 for 192.168.1.131:49052  sock=14
04/08/2020 10:20:33 copy_tiles: allocating first_line at size 41
04/08/2020 10:20:41 created selwin: 0x2a0002c
04/08/2020 10:20:41 called initialize_xfixes()
04/08/2020 10:20:48 selection_send: no send: uninitialized clients
04/08/2020 10:20:48 selection_send: no send: uninitialized clients


Not sure I understand what's going on. WebSockets seem to be used. My x11vnc seems to be fine since other clients successfully connect. I'm running the simplest test possible with noVNC.

Any ideas on what to do?







--
Sander A. Smith
President

Sericon Technology Inc.
71 Marquette Ave.
Toronto, Ontario M6A 1X8
(416)781-3988

Link to me on LinkedIn
http://www.linkedin.com/in/sandersmith

Learn about the dangers of home routers and how you can protect yourself
http://www.RouterCheck.com

http://www.sericontech.com

Samuel Mannehed

unread,
Aug 5, 2020, 11:00:44 AM8/5/20
to Sander A. Smith, no...@googlegroups.com
Hi Sander,


> x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbport 5900
> -shared
>
> ...
>
> I then installed noVNC on another computer on the network. I did this
> with apt install, so I presumably have the latest noVNC, WebSockify
> and a little web server all packaged up nicely.

I would guess that apt does NOT have the latest noVNC by far. The last
time I checked they provided a 10 year old variant.

Anyway, that should work too.

> I go to
>
> http://localhost:6080/vnc.html?host=192.168.1.122&port=5900
>
> and the noVNC interface comes up. However, if I try to connect, it
> just says "Connecting..." and never moves on.

Your problem is that you're pointing out the port to the VNC server,
which talks TCP. You should be pointing out the port to the Websockify
proxy.

It's usually setup like this:

* VNC port: 5900 (TCP)
* Websockify proxies from TCP data at 5900 to WebSocket data at 6080
* noVNC connects to port 6080

Hope that clarifies things.

Sander A. Smith

unread,
Aug 6, 2020, 3:04:14 PM8/6/20
to Samuel Mannehed, no...@googlegroups.com
Hey Samuel,

Thanks for your help.

I think my problem was that I was misunderstanding how everything fit together. I did some simple tests now and everything seems to work.

I was also wrong when I said I installed everything with apt. I used snap and I believe that's the latest version of everything, right?




Samuel Mannehed

unread,
Aug 7, 2020, 5:28:51 AM8/7/20
to Sander A. Smith, no...@googlegroups.com
Hi Sander,

> I think my problem was that I was misunderstanding how everything fit
> together. I did some simple tests now and everything seems to work.

I'm glad to hear everything is working for you!

Do you have suggestions how to make things more clear to avoid future
misunderstandings?

> I was also wrong when I said I installed everything with apt. I used
> snap and I believe that's the latest version of everything, right?

Yes I believe so.

Sander A. Smith

unread,
Aug 7, 2020, 10:11:29 AM8/7/20
to Samuel Mannehed, no...@googlegroups.com
>  Do you have suggestions how to make things more clear to avoid future misunderstandings?

Excellent question!

Issue 1 - The Demo sucks

A few months ago I was planning out a project and I needed something that looked like noVNC. I was very happy to find it and started to learn more about it. So the first thing I do is run the demo which is a huge failure. My first impressions - this thing must be a huge POS if their demo doesn't even work. I later find out that you must understand a HUGE amount of information that's scattered all over the place to even run the demo. 

This needs to be fixed.

Issue 2 - Information in multiple places

When I wanted to learn more, I went to the website. Bad idea. The REAL information is on GitHub. I didn't really begin to explore there (probably my fault) until I got pretty confused.

Issue 3 - There needs to be a high-level explanation of all of the pieces and how they fit together.

I have a fairly complex use case. When I architect it in my head and try to see where noVNC fits in I realize that noVNC involves 4 (possibly different) devices:

Device 1 runs the VNC server
Device 2 runs Websockify
Device 3 serves the JS files
Device 4 runs the browser

There's not a lot of information about Websockify, so should it (could it?) run on Device 1, 3, 4 or can it be a completely separate device? Can Device 3 be AWS? It's not really crystal clear how everything works together - perhaps a nice picture is in order here.

So that's my feedback after thinking about it a little while. Hope it helps.






Samuel Mannehed

unread,
Aug 7, 2020, 10:18:08 AM8/7/20
to no...@googlegroups.com
Hi Sander,
That's great feedback, thanks!
Reply all
Reply to author
Forward
0 new messages