Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. VNC not working on any browser
QtWS25 Last Chance

VNC not working on any browser

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 3.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    WernerT.A.
    wrote on 18 Sept 2018, 18:03 last edited by
    #1

    Hi,
    I'm trying to run my QT application (or any example for that matter) as a headless VNC server using:

    -platform vnc:mode=websocket
    

    Thing is, I can successfully connect to it using standard VNC clients such as VNC Viewer and ThigthVNC but when I try to run it on my browser (http://localhost:5900) it just loads indefinitely.
    I know it should host a HTML5 client (noVNC) underneath the blankets and that is exactly what I need but whenever I try it just does not show any messages or error, it just keeps on loading.
    Anyone has any idea how to debug this problem or tell me if i'm missing anything?

    Tried it on qt 5.10 and 5.11 and a linux virtual machine and a linux notebook, both with ubuntu 14.04.
    Also tried to specify my own noVNC path with the 'viewer' flag and the result is the same always.

    Thx!

    P 1 Reply Last reply 18 Sept 2018, 22:35
    0
    • W WernerT.A.
      18 Sept 2018, 18:03

      Hi,
      I'm trying to run my QT application (or any example for that matter) as a headless VNC server using:

      -platform vnc:mode=websocket
      

      Thing is, I can successfully connect to it using standard VNC clients such as VNC Viewer and ThigthVNC but when I try to run it on my browser (http://localhost:5900) it just loads indefinitely.
      I know it should host a HTML5 client (noVNC) underneath the blankets and that is exactly what I need but whenever I try it just does not show any messages or error, it just keeps on loading.
      Anyone has any idea how to debug this problem or tell me if i'm missing anything?

      Tried it on qt 5.10 and 5.11 and a linux virtual machine and a linux notebook, both with ubuntu 14.04.
      Also tried to specify my own noVNC path with the 'viewer' flag and the result is the same always.

      Thx!

      P Offline
      P Offline
      Pablo J. Rogina
      wrote on 18 Sept 2018, 22:35 last edited by
      #2

      @WernerT.A. said in VNC not working on any browser:

      I know it should host a HTML5 client (noVNC) underneath the blankets and that is exactly what I need but whenever I try it just does not show any messages or error,

      It looks like you are missing a VNC client for the browser. Could you share what you have tried so far?

      Have you checked the instructions for the noVNC client?

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      1
      • W Offline
        W Offline
        WernerT.A.
        wrote on 19 Sept 2018, 14:17 last edited by
        #3

        Ill list everything I've tried so far that I can remember, so for the setup I have a notebook with a native ubuntu 14.04, and another with windows 10 and Linux on a virtual machine, so:

        Running the application on Linux virtual machine:

        • Connect to http://localhost:5900 using chrome and firefox from inside the virtual machine
        • Connect to http://192.168.56.101:5900 using chrome, firefox and edge from the windows host
        • Connect to the vnc using [pigshell's vnc link](I it is think the original repo where this features was implemented): pigshell.github.io/noVNC/qtvnc.html#host=192.168.56.1014&port=5900 using firefox, edge and chrome from windows host.
        • Connect to the vnc using pigshell's vnc link using firefox, and chrome from Linux virtual machine
        • Connect to it using the noVNC client downloaded from the official website on all the above combinations.

        Running the application on Linux notebook:
        Same tests as I've done on the virtual machine

        When using my own noVNC client I get the following errors:

        For Microsoft Edge:

        SCRIPT12007: SCRIPT12007: WebSocket Error: Network Error 12007, The server name or address could not be resolved
        Msg: Server disconnected (code: 1006) 
        

        On chrome:

        WebSocket connection to 'ws://192.168.56.101:5900/websockify' failed: Error during WebSocket handshake: net::ERR_INVALID_HTTP_RESPONSE
        Msg: Server disconnected (code: 1006)
        

        Which causes my QT application to shut down and return Segmentation fault
        And firefox:

        Firefox can’t establish a connection to the server at ws://192.168.56.101:5900/websockify.
        Msg: Server disconnected (code: 1006)
        

        Also causing segmentation fault

        When I try to connect directly to the localhost and port using the built in noVNC client from inside the virtual machine I get the following:

        Chrome:

        Firefox:
        Get stuck on 'Transferring data from localhost...' for a while and the finally on the browser it shows:

        RFB 003.003
        ���
        

        It seems that this has something to do with the wrong port on the vnc server but I have no control as to what happens when I try to go directly to localhost
        and the console shows:

        The character encoding of the plain text document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the file needs to be declared in the transfer protocol or file needs to use a byte order mark as an encoding signature.
        

        Then segmentation fault on the qt app

        Chrome:
        Just show this on the page and nothing on the console:

        This page isn’t working
        localhost sent an invalid response.
        ERR_INVALID_HTTP_RESPONSE
        

        with no segmentation fault on the app

        @Pablo-J.-Rogina said in VNC not working on any browser:

        Have you checked the instructions for the noVNC client?

        I've tried using the pure noVNC client and it says 'it does require WebSockets support' wich I belive happends when I pass the mode=websocket argument to my application if i'm not mistaken.

        I think that is about all I have.

        P 1 Reply Last reply 19 Sept 2018, 18:16
        0
        • W WernerT.A.
          19 Sept 2018, 14:17

          Ill list everything I've tried so far that I can remember, so for the setup I have a notebook with a native ubuntu 14.04, and another with windows 10 and Linux on a virtual machine, so:

          Running the application on Linux virtual machine:

          • Connect to http://localhost:5900 using chrome and firefox from inside the virtual machine
          • Connect to http://192.168.56.101:5900 using chrome, firefox and edge from the windows host
          • Connect to the vnc using [pigshell's vnc link](I it is think the original repo where this features was implemented): pigshell.github.io/noVNC/qtvnc.html#host=192.168.56.1014&port=5900 using firefox, edge and chrome from windows host.
          • Connect to the vnc using pigshell's vnc link using firefox, and chrome from Linux virtual machine
          • Connect to it using the noVNC client downloaded from the official website on all the above combinations.

          Running the application on Linux notebook:
          Same tests as I've done on the virtual machine

          When using my own noVNC client I get the following errors:

          For Microsoft Edge:

          SCRIPT12007: SCRIPT12007: WebSocket Error: Network Error 12007, The server name or address could not be resolved
          Msg: Server disconnected (code: 1006) 
          

          On chrome:

          WebSocket connection to 'ws://192.168.56.101:5900/websockify' failed: Error during WebSocket handshake: net::ERR_INVALID_HTTP_RESPONSE
          Msg: Server disconnected (code: 1006)
          

          Which causes my QT application to shut down and return Segmentation fault
          And firefox:

          Firefox can’t establish a connection to the server at ws://192.168.56.101:5900/websockify.
          Msg: Server disconnected (code: 1006)
          

          Also causing segmentation fault

          When I try to connect directly to the localhost and port using the built in noVNC client from inside the virtual machine I get the following:

          Chrome:

          Firefox:
          Get stuck on 'Transferring data from localhost...' for a while and the finally on the browser it shows:

          RFB 003.003
          ���
          

          It seems that this has something to do with the wrong port on the vnc server but I have no control as to what happens when I try to go directly to localhost
          and the console shows:

          The character encoding of the plain text document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the file needs to be declared in the transfer protocol or file needs to use a byte order mark as an encoding signature.
          

          Then segmentation fault on the qt app

          Chrome:
          Just show this on the page and nothing on the console:

          This page isn’t working
          localhost sent an invalid response.
          ERR_INVALID_HTTP_RESPONSE
          

          with no segmentation fault on the app

          @Pablo-J.-Rogina said in VNC not working on any browser:

          Have you checked the instructions for the noVNC client?

          I've tried using the pure noVNC client and it says 'it does require WebSockets support' wich I belive happends when I pass the mode=websocket argument to my application if i'm not mistaken.

          I think that is about all I have.

          P Offline
          P Offline
          Pablo J. Rogina
          wrote on 19 Sept 2018, 18:16 last edited by
          #4

          @WernerT.A. said in VNC not working on any browser:

          connect to the vnc using [pigshell's vnc link](I it is think the original repo where this features was implemented): pigshell.github.io/noVNC/qtvnc.html#host=192.168.56.1014&port=5900 using firefox, edge and chrome from windows host.

          This is not going to work... you're trying for the remote server (Github) to reach your Qt app in your internal LAN (host=192.168.56.1014) even the IP in that URL is not valid.
          For this service to work, you need to forward the port (5900) of your machine running the Qt app to the external IP in your environment, and then point the service to such external IP + port

          Upvote the answer(s) that helped you solve the issue
          Use "Topic Tools" button to mark your post as Solved
          Add screenshots via postimage.org
          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          4
          • W Offline
            W Offline
            WernerT.A.
            wrote on 20 Sept 2018, 15:57 last edited by
            #5

            So I have managed to use the original noVNC client using the launch.sh script. but when I try to pass the same client as a 'viewer' option it still does not work. Thing is on the application I need, I really have to make it work with the built in server.

            @Pablo-J.-Rogina said in VNC not working on any browser:

            you're trying for the remote server (Github) to reach your Qt app in your internal LAN (host=192.168.56.1014)

            This seems exacly what Pigshell does on his example, if you look at the gif that he put in his readme. or am I mistaken?
            Using a local version of the VNC (so I should not worry about port forwarding) gives me the same problems, I have downloaded the client, and pass it's path to the 'viewer' argument as I said before, and ran the html file with the port and ip on the 3 browser and the results where exactly the same as when using the external GitHub link.

            I'm currently in contact with Danes (Pigshell) and he is being kind enough to help me ou, on his computer it worked fine, and he let a server running with a application for me to try out, when I access his link from here, the exact same errors are appearing, so to problem should be somewhere other then the application itself.

            1 Reply Last reply
            0

            3/5

            19 Sept 2018, 14:17

            • Login

            • Login or register to search.
            3 out of 5
            • First post
              3/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved