Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Running VNC Server on Embedded Linux
QtWS25 Last Chance

Running VNC Server on Embedded Linux

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
10 Posts 7 Posters 12.1k 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.
  • R Offline
    R Offline
    Ravikiran V N
    wrote on last edited by
    #1

    Hi ,All,

    I want to run VNC Server session on embedded Linux so that other display systems such as Desktop PCs within network to connect to it as VNC Client. I am using Qt 5.5.1 on my target and want to publish my HMI on multiple displays using VNC protocol. I know there is/was some option available on Qt 4.x based QWS applications. Is the same can be used to QPA based apps or not? is it we have to do something different? if any body has done the same thing, please give some inputs on the same.

    Thanks
    Aster.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      deleted184
      wrote on last edited by
      #2

      Hi @Ravikiran-V-N ,

      Maybe i can "help" you on this.

      As you said there was a vnc plugin in the previous version of Qt (4.X). And you were able to call your application like this:

      ./myCuteQt4XApp -display VNC:size=500x400

      With the version 5.5.x opr 5.6.x, up to now , there is no such support of VNC, unfortunately (i don't know why, but i'm sure there is a good reason).

      But the "good news" is that you can have a VNC server on your embedded device and remotely access to your application. I'm using x11vnc, which is an application that you can have on your embedded device. I'm using Buildroot to build my filesystem, it's easy to add this application directly on the rootfs (make sure to have all the required libraries to have x11vnc enabled). I don't know if on Yocto it's the same because i've never used Yocto.

      So once you have x11vnc on your target serious things can start. You If you are able to run your application on your target, it means that you know all the things related to plugin, libraries and other stuff so i'm doing to bother you with this.

      So once x11vnc is installed, you can use it like this:

      1) Start your Qt5 application:

      ./myCuteQt551App -platform linuxfb -geometry WxH &
      

      Where W and H are respectively the Width and the Height of your graphical view (in integer, for instance 240x320).

      2) Start your x11vnc server

      x11vnc -noipv6 -rawfb /dev/fb0 -clip WxH+0+0
      

      You should see the x11vnc printing some information about the port number (which should be 5900). I'm using the default framebuffer (/dev/fb0) because, i specify when launching the application linuxfb which point directly to the default framebuffer device whose the node is /dev/fb0.

      If there is no errors, it means everything is Ok!

      3) Start your VNC Client

      You can start your VNC client to connect to your embedded device on the port specified by x11vnc (which should be 5900 by default). After that you should see your cute Qt5.5.1 application (Yeah!!).

      4) ... BUTs

      As you will see, things are not perfect, because in my case for instance i'm not able to make the mouse working;
      and i think you will probably have the same issue (if not let me know ;) ).

      I was able to make mouse working, but i must connect my mouse directly to my embedded device and launch my Qt5.x app with some options (-evdevmouse:/dev/input/event0), which is not the best practice. So up to now, i'm stuck at this point, but if i find something useful i will post something on this forum.

      5) More about Qt5.x

      There is many options to use when you call your Qt5.x option, -evdevmouse, -evdevkeyboard etc.
      Don't forget to use these options during your work ;) .

      6) Support of VNC on Qt5.x

      Finally, i've asked to an official member of Qt about the support of VNC on the versions 5.x. And unfortunately she answer me that, after having a discussion with some "official" technical guys working on Qt, the answer was unfortunately NO .. at least up to now.

      Emerson SiegaE X 2 Replies Last reply
      4
      • R Offline
        R Offline
        Ravikiran V N
        wrote on last edited by
        #3

        Hi @bignumb ,

        Thanks for the details and interest to reply to my query.

        I am using Yocto , so will check the possibilities and revert to you if I face any issues.

        1 Reply Last reply
        0
        • H Offline
          H Offline
          hfrmobile
          wrote on last edited by
          #4

          Thanks a lot! You saved my day!

          +++ Programming is a kind of art but not all programmers are artists. +++

          1 Reply Last reply
          0
          • D deleted184

            Hi @Ravikiran-V-N ,

            Maybe i can "help" you on this.

            As you said there was a vnc plugin in the previous version of Qt (4.X). And you were able to call your application like this:

            ./myCuteQt4XApp -display VNC:size=500x400

            With the version 5.5.x opr 5.6.x, up to now , there is no such support of VNC, unfortunately (i don't know why, but i'm sure there is a good reason).

            But the "good news" is that you can have a VNC server on your embedded device and remotely access to your application. I'm using x11vnc, which is an application that you can have on your embedded device. I'm using Buildroot to build my filesystem, it's easy to add this application directly on the rootfs (make sure to have all the required libraries to have x11vnc enabled). I don't know if on Yocto it's the same because i've never used Yocto.

            So once you have x11vnc on your target serious things can start. You If you are able to run your application on your target, it means that you know all the things related to plugin, libraries and other stuff so i'm doing to bother you with this.

            So once x11vnc is installed, you can use it like this:

            1) Start your Qt5 application:

            ./myCuteQt551App -platform linuxfb -geometry WxH &
            

            Where W and H are respectively the Width and the Height of your graphical view (in integer, for instance 240x320).

            2) Start your x11vnc server

            x11vnc -noipv6 -rawfb /dev/fb0 -clip WxH+0+0
            

            You should see the x11vnc printing some information about the port number (which should be 5900). I'm using the default framebuffer (/dev/fb0) because, i specify when launching the application linuxfb which point directly to the default framebuffer device whose the node is /dev/fb0.

            If there is no errors, it means everything is Ok!

            3) Start your VNC Client

            You can start your VNC client to connect to your embedded device on the port specified by x11vnc (which should be 5900 by default). After that you should see your cute Qt5.5.1 application (Yeah!!).

            4) ... BUTs

            As you will see, things are not perfect, because in my case for instance i'm not able to make the mouse working;
            and i think you will probably have the same issue (if not let me know ;) ).

            I was able to make mouse working, but i must connect my mouse directly to my embedded device and launch my Qt5.x app with some options (-evdevmouse:/dev/input/event0), which is not the best practice. So up to now, i'm stuck at this point, but if i find something useful i will post something on this forum.

            5) More about Qt5.x

            There is many options to use when you call your Qt5.x option, -evdevmouse, -evdevkeyboard etc.
            Don't forget to use these options during your work ;) .

            6) Support of VNC on Qt5.x

            Finally, i've asked to an official member of Qt about the support of VNC on the versions 5.x. And unfortunately she answer me that, after having a discussion with some "official" technical guys working on Qt, the answer was unfortunately NO .. at least up to now.

            Emerson SiegaE Offline
            Emerson SiegaE Offline
            Emerson Siega
            wrote on last edited by Emerson Siega
            #5

            @bignumb Hi, I'm sorry for reply this old topic, but I followed the steps you described to configure x11vnc and my Qt app to work together, and when I tried to connect to my VNC Server with a client, the image appeared distorted. Look the image bellow.

            0_1498847803480_Screenshot_2017-06-30_15-36-17.png

            My app is built with Qt 5.7.0 and is running on a Raspberry pi 3, without GUI.

            Do you have some idea of how can I resolve this issue?
            Thank's!

            1 Reply Last reply
            0
            • hskoglundH Offline
              hskoglundH Offline
              hskoglund
              wrote on last edited by
              #6

              Hi just guessing but it looks like there is a WxH (width and height) mismatch somewhere in the settings on the Raspberry.

              Emerson SiegaE 1 Reply Last reply
              0
              • hskoglundH hskoglund

                Hi just guessing but it looks like there is a WxH (width and height) mismatch somewhere in the settings on the Raspberry.

                Emerson SiegaE Offline
                Emerson SiegaE Offline
                Emerson Siega
                wrote on last edited by
                #7

                @hskoglund Hi, thank's for your answer, but I think this is not the problem.
                I tried to put WxH fixed in x11vnc and in my app settings, persisting on the same problem.

                If you have some other idea, please let me know! :)

                1 Reply Last reply
                0
                • Emerson SiegaE Offline
                  Emerson SiegaE Offline
                  Emerson Siega
                  wrote on last edited by
                  #8

                  My problem was solved.
                  https://forum.qt.io/topic/81247/vnc-on-embedded-raspberry-app/6

                  1 Reply Last reply
                  0
                  • D deleted184

                    Hi @Ravikiran-V-N ,

                    Maybe i can "help" you on this.

                    As you said there was a vnc plugin in the previous version of Qt (4.X). And you were able to call your application like this:

                    ./myCuteQt4XApp -display VNC:size=500x400

                    With the version 5.5.x opr 5.6.x, up to now , there is no such support of VNC, unfortunately (i don't know why, but i'm sure there is a good reason).

                    But the "good news" is that you can have a VNC server on your embedded device and remotely access to your application. I'm using x11vnc, which is an application that you can have on your embedded device. I'm using Buildroot to build my filesystem, it's easy to add this application directly on the rootfs (make sure to have all the required libraries to have x11vnc enabled). I don't know if on Yocto it's the same because i've never used Yocto.

                    So once you have x11vnc on your target serious things can start. You If you are able to run your application on your target, it means that you know all the things related to plugin, libraries and other stuff so i'm doing to bother you with this.

                    So once x11vnc is installed, you can use it like this:

                    1) Start your Qt5 application:

                    ./myCuteQt551App -platform linuxfb -geometry WxH &
                    

                    Where W and H are respectively the Width and the Height of your graphical view (in integer, for instance 240x320).

                    2) Start your x11vnc server

                    x11vnc -noipv6 -rawfb /dev/fb0 -clip WxH+0+0
                    

                    You should see the x11vnc printing some information about the port number (which should be 5900). I'm using the default framebuffer (/dev/fb0) because, i specify when launching the application linuxfb which point directly to the default framebuffer device whose the node is /dev/fb0.

                    If there is no errors, it means everything is Ok!

                    3) Start your VNC Client

                    You can start your VNC client to connect to your embedded device on the port specified by x11vnc (which should be 5900 by default). After that you should see your cute Qt5.5.1 application (Yeah!!).

                    4) ... BUTs

                    As you will see, things are not perfect, because in my case for instance i'm not able to make the mouse working;
                    and i think you will probably have the same issue (if not let me know ;) ).

                    I was able to make mouse working, but i must connect my mouse directly to my embedded device and launch my Qt5.x app with some options (-evdevmouse:/dev/input/event0), which is not the best practice. So up to now, i'm stuck at this point, but if i find something useful i will post something on this forum.

                    5) More about Qt5.x

                    There is many options to use when you call your Qt5.x option, -evdevmouse, -evdevkeyboard etc.
                    Don't forget to use these options during your work ;) .

                    6) Support of VNC on Qt5.x

                    Finally, i've asked to an official member of Qt about the support of VNC on the versions 5.x. And unfortunately she answer me that, after having a discussion with some "official" technical guys working on Qt, the answer was unfortunately NO .. at least up to now.

                    X Offline
                    X Offline
                    xumingyifrend
                    wrote on last edited by
                    #9

                    @bignumb
                    hi
                    Can you handle the problem that the mouse can not be controlled? I have the same problem now.
                    can you help me?

                    T 1 Reply Last reply
                    0
                    • X xumingyifrend

                      @bignumb
                      hi
                      Can you handle the problem that the mouse can not be controlled? I have the same problem now.
                      can you help me?

                      T Offline
                      T Offline
                      tristanramseyer
                      wrote on last edited by
                      #10

                      @xumingyifrend said in Running VNC Server on Embedded Linux:

                      @bignumb
                      hi
                      Can you handle the problem that the mouse can not be controlled? I have the same problem now.
                      can you help me?

                      For me the problem was that my Kernel had CONFIG_INPUT_UINPUT not set.

                      1 Reply Last reply
                      1

                      • Login

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