root needed to launch X11 application











up vote
1
down vote

favorite












I'm building a Qt application using QML technologie. QML use OpenGL.



The computer running the build is a CentOS 6.7, with intel GPU.
I'm using it only on SSH, and I use XMing (or VcxSrv sometimes) to open graphical applications.



I had multiple trouble to make it works but by googling my problems and playing with xauth I can now remotly open my QML application.



BUT



When running my application with a normal user I get :



KiTTY X11 proxy: Unsupported authorisation protocol
QXcbConnection: Could not connect to display localhost:10.0



I noticed that the error message say Unsupported (a lot of SO question are about Wrong protocol)



AND



I can only open it in root (sudo does't work here, I need to su), and I got multiple errors :




failed to get the current screen resources
WARNING: Application /home/user/QMLapp/app calling GLX 1.3 function "glXCreatePbuffer" when GLX 1.3 is not supported! This is an application bug!
QXcbConnection: XCB error: 170 (Unknown), sequence: 163, resource id: 90, major code: 146 (Unknown), minor code: 20




Note :
glxinfo seems fine and direct rendering is activated.
glxgeers works fine too and don't need to be root to work



First question : Can I easily upgrade my GLX ?
Second question : Why it only works in root ?










share|improve this question
















bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.



















    up vote
    1
    down vote

    favorite












    I'm building a Qt application using QML technologie. QML use OpenGL.



    The computer running the build is a CentOS 6.7, with intel GPU.
    I'm using it only on SSH, and I use XMing (or VcxSrv sometimes) to open graphical applications.



    I had multiple trouble to make it works but by googling my problems and playing with xauth I can now remotly open my QML application.



    BUT



    When running my application with a normal user I get :



    KiTTY X11 proxy: Unsupported authorisation protocol
    QXcbConnection: Could not connect to display localhost:10.0



    I noticed that the error message say Unsupported (a lot of SO question are about Wrong protocol)



    AND



    I can only open it in root (sudo does't work here, I need to su), and I got multiple errors :




    failed to get the current screen resources
    WARNING: Application /home/user/QMLapp/app calling GLX 1.3 function "glXCreatePbuffer" when GLX 1.3 is not supported! This is an application bug!
    QXcbConnection: XCB error: 170 (Unknown), sequence: 163, resource id: 90, major code: 146 (Unknown), minor code: 20




    Note :
    glxinfo seems fine and direct rendering is activated.
    glxgeers works fine too and don't need to be root to work



    First question : Can I easily upgrade my GLX ?
    Second question : Why it only works in root ?










    share|improve this question
















    bumped to the homepage by Community 2 days ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I'm building a Qt application using QML technologie. QML use OpenGL.



      The computer running the build is a CentOS 6.7, with intel GPU.
      I'm using it only on SSH, and I use XMing (or VcxSrv sometimes) to open graphical applications.



      I had multiple trouble to make it works but by googling my problems and playing with xauth I can now remotly open my QML application.



      BUT



      When running my application with a normal user I get :



      KiTTY X11 proxy: Unsupported authorisation protocol
      QXcbConnection: Could not connect to display localhost:10.0



      I noticed that the error message say Unsupported (a lot of SO question are about Wrong protocol)



      AND



      I can only open it in root (sudo does't work here, I need to su), and I got multiple errors :




      failed to get the current screen resources
      WARNING: Application /home/user/QMLapp/app calling GLX 1.3 function "glXCreatePbuffer" when GLX 1.3 is not supported! This is an application bug!
      QXcbConnection: XCB error: 170 (Unknown), sequence: 163, resource id: 90, major code: 146 (Unknown), minor code: 20




      Note :
      glxinfo seems fine and direct rendering is activated.
      glxgeers works fine too and don't need to be root to work



      First question : Can I easily upgrade my GLX ?
      Second question : Why it only works in root ?










      share|improve this question















      I'm building a Qt application using QML technologie. QML use OpenGL.



      The computer running the build is a CentOS 6.7, with intel GPU.
      I'm using it only on SSH, and I use XMing (or VcxSrv sometimes) to open graphical applications.



      I had multiple trouble to make it works but by googling my problems and playing with xauth I can now remotly open my QML application.



      BUT



      When running my application with a normal user I get :



      KiTTY X11 proxy: Unsupported authorisation protocol
      QXcbConnection: Could not connect to display localhost:10.0



      I noticed that the error message say Unsupported (a lot of SO question are about Wrong protocol)



      AND



      I can only open it in root (sudo does't work here, I need to su), and I got multiple errors :




      failed to get the current screen resources
      WARNING: Application /home/user/QMLapp/app calling GLX 1.3 function "glXCreatePbuffer" when GLX 1.3 is not supported! This is an application bug!
      QXcbConnection: XCB error: 170 (Unknown), sequence: 163, resource id: 90, major code: 146 (Unknown), minor code: 20




      Note :
      glxinfo seems fine and direct rendering is activated.
      glxgeers works fine too and don't need to be root to work



      First question : Can I easily upgrade my GLX ?
      Second question : Why it only works in root ?







      linux centos x11 qt xming






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 1 '15 at 8:13

























      asked Sep 30 '15 at 15:00









      MokaT

      11817




      11817





      bumped to the homepage by Community 2 days ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 2 days ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          0
          down vote













          QXcbConnection: Could not connect to display localhost:10.0



          The error above may contain some clues. It means that, for this user, the variable $DISPLAY is set to localhost:10.0



          After you su to root, you can check the variable again with echo $DISPLAY. then change the value of the variable for the normal user accordingly.



          Correct value is probably localhost:0.0






          share|improve this answer





















          • Nop, the DISPLAY var is 10.0 on root too. # echo $DISPLAY localhost:10.0. I've tried to change it, it's no longer working on root with 0.0
            – MokaT
            Oct 1 '15 at 9:37




















          up vote
          0
          down vote













          The DISPLAY value of localhost:10.0 indicates you're on a SSH-forwarded X11 connection, as you stated in the question. If you change the DISPLAY to :0.0, then you're saying you want the program to present its windows on the screen that is directly attached to the remote computer... and if you're not physically near it, that isn't going to be very useful.



          Direct rendering would require that the GUI application have direct access to the actual GPU that draws to your screen... which is of course impossible when the screen and the application are not in the same host.



          It looks like this application might be designed to be used only locally. If it cannot gracefully fall back to indirect rendering, it cannot be used over a remote X11 connection: direct rendering requires that the GPU that will actually do the drawing should be in the same computer as the application, and not separated from it by a network connection.



          If you're using a remote X11 connection with Xming or VcXsrv, then your OpenGL support levels depends primarily on what OpenGL levels your Xming or VcXsrv will support. Of course the remote computer also needs the appropriate OpenGL libraries present, but usually the package manager or the application installer takes care of that.



          When you're running it as a regular user, are you running as the user you logged in your X11-forwarding SSH connection, or have you switched to another user account on the remote host after logging in?



          Switching user accounts while preserving X11 forwarding requires a bit of extra effort: not only must you ensure that the value of the DISPLAY variable is preserved, you must also make sure the target user has access to the contents of the ~/.Xauthority file of the source user. You can copy the ~/.Xauthority file to some other location (e.g. into /tmp) and then use the XAUTHORITY environment variable to point to it.



          For example:



          <logged in to remote host as user1, with X11 forwarding>
          user1$ echo $DISPLAY
          localhost:10.0
          user1$ cp ~/.Xauthority /tmp/user1.Xauthority
          user1$ chgrp user2 /tmp/user1.Xauthority
          user1$ chmod 640 /tmp/user1.Xauthority
          user1$ sudo -u user2 -i
          user2$ export DISPLAY=localhost:10.0
          user2$ export XAUTHORITY=/tmp/user1.Xauthority
          <now running a X11 GUI application should be possible>


          This can be often avoided when you're switching from regular user to root, since root can read everyone's files... including the ~/.Xauthority file. So when switching from user1 to root the only things that need to be done is to maintain the DISPLAY value and point XAUTHORITY to /home/user1/.Xauthority. Some Linux distributions include scripts or PAM modules that do this for you automatically when switching from a regular user to root.






          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f233031%2froot-needed-to-launch-x11-application%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            QXcbConnection: Could not connect to display localhost:10.0



            The error above may contain some clues. It means that, for this user, the variable $DISPLAY is set to localhost:10.0



            After you su to root, you can check the variable again with echo $DISPLAY. then change the value of the variable for the normal user accordingly.



            Correct value is probably localhost:0.0






            share|improve this answer





















            • Nop, the DISPLAY var is 10.0 on root too. # echo $DISPLAY localhost:10.0. I've tried to change it, it's no longer working on root with 0.0
              – MokaT
              Oct 1 '15 at 9:37

















            up vote
            0
            down vote













            QXcbConnection: Could not connect to display localhost:10.0



            The error above may contain some clues. It means that, for this user, the variable $DISPLAY is set to localhost:10.0



            After you su to root, you can check the variable again with echo $DISPLAY. then change the value of the variable for the normal user accordingly.



            Correct value is probably localhost:0.0






            share|improve this answer





















            • Nop, the DISPLAY var is 10.0 on root too. # echo $DISPLAY localhost:10.0. I've tried to change it, it's no longer working on root with 0.0
              – MokaT
              Oct 1 '15 at 9:37















            up vote
            0
            down vote










            up vote
            0
            down vote









            QXcbConnection: Could not connect to display localhost:10.0



            The error above may contain some clues. It means that, for this user, the variable $DISPLAY is set to localhost:10.0



            After you su to root, you can check the variable again with echo $DISPLAY. then change the value of the variable for the normal user accordingly.



            Correct value is probably localhost:0.0






            share|improve this answer












            QXcbConnection: Could not connect to display localhost:10.0



            The error above may contain some clues. It means that, for this user, the variable $DISPLAY is set to localhost:10.0



            After you su to root, you can check the variable again with echo $DISPLAY. then change the value of the variable for the normal user accordingly.



            Correct value is probably localhost:0.0







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Oct 1 '15 at 9:06









            David Dai

            1,61221126




            1,61221126












            • Nop, the DISPLAY var is 10.0 on root too. # echo $DISPLAY localhost:10.0. I've tried to change it, it's no longer working on root with 0.0
              – MokaT
              Oct 1 '15 at 9:37




















            • Nop, the DISPLAY var is 10.0 on root too. # echo $DISPLAY localhost:10.0. I've tried to change it, it's no longer working on root with 0.0
              – MokaT
              Oct 1 '15 at 9:37


















            Nop, the DISPLAY var is 10.0 on root too. # echo $DISPLAY localhost:10.0. I've tried to change it, it's no longer working on root with 0.0
            – MokaT
            Oct 1 '15 at 9:37






            Nop, the DISPLAY var is 10.0 on root too. # echo $DISPLAY localhost:10.0. I've tried to change it, it's no longer working on root with 0.0
            – MokaT
            Oct 1 '15 at 9:37














            up vote
            0
            down vote













            The DISPLAY value of localhost:10.0 indicates you're on a SSH-forwarded X11 connection, as you stated in the question. If you change the DISPLAY to :0.0, then you're saying you want the program to present its windows on the screen that is directly attached to the remote computer... and if you're not physically near it, that isn't going to be very useful.



            Direct rendering would require that the GUI application have direct access to the actual GPU that draws to your screen... which is of course impossible when the screen and the application are not in the same host.



            It looks like this application might be designed to be used only locally. If it cannot gracefully fall back to indirect rendering, it cannot be used over a remote X11 connection: direct rendering requires that the GPU that will actually do the drawing should be in the same computer as the application, and not separated from it by a network connection.



            If you're using a remote X11 connection with Xming or VcXsrv, then your OpenGL support levels depends primarily on what OpenGL levels your Xming or VcXsrv will support. Of course the remote computer also needs the appropriate OpenGL libraries present, but usually the package manager or the application installer takes care of that.



            When you're running it as a regular user, are you running as the user you logged in your X11-forwarding SSH connection, or have you switched to another user account on the remote host after logging in?



            Switching user accounts while preserving X11 forwarding requires a bit of extra effort: not only must you ensure that the value of the DISPLAY variable is preserved, you must also make sure the target user has access to the contents of the ~/.Xauthority file of the source user. You can copy the ~/.Xauthority file to some other location (e.g. into /tmp) and then use the XAUTHORITY environment variable to point to it.



            For example:



            <logged in to remote host as user1, with X11 forwarding>
            user1$ echo $DISPLAY
            localhost:10.0
            user1$ cp ~/.Xauthority /tmp/user1.Xauthority
            user1$ chgrp user2 /tmp/user1.Xauthority
            user1$ chmod 640 /tmp/user1.Xauthority
            user1$ sudo -u user2 -i
            user2$ export DISPLAY=localhost:10.0
            user2$ export XAUTHORITY=/tmp/user1.Xauthority
            <now running a X11 GUI application should be possible>


            This can be often avoided when you're switching from regular user to root, since root can read everyone's files... including the ~/.Xauthority file. So when switching from user1 to root the only things that need to be done is to maintain the DISPLAY value and point XAUTHORITY to /home/user1/.Xauthority. Some Linux distributions include scripts or PAM modules that do this for you automatically when switching from a regular user to root.






            share|improve this answer

























              up vote
              0
              down vote













              The DISPLAY value of localhost:10.0 indicates you're on a SSH-forwarded X11 connection, as you stated in the question. If you change the DISPLAY to :0.0, then you're saying you want the program to present its windows on the screen that is directly attached to the remote computer... and if you're not physically near it, that isn't going to be very useful.



              Direct rendering would require that the GUI application have direct access to the actual GPU that draws to your screen... which is of course impossible when the screen and the application are not in the same host.



              It looks like this application might be designed to be used only locally. If it cannot gracefully fall back to indirect rendering, it cannot be used over a remote X11 connection: direct rendering requires that the GPU that will actually do the drawing should be in the same computer as the application, and not separated from it by a network connection.



              If you're using a remote X11 connection with Xming or VcXsrv, then your OpenGL support levels depends primarily on what OpenGL levels your Xming or VcXsrv will support. Of course the remote computer also needs the appropriate OpenGL libraries present, but usually the package manager or the application installer takes care of that.



              When you're running it as a regular user, are you running as the user you logged in your X11-forwarding SSH connection, or have you switched to another user account on the remote host after logging in?



              Switching user accounts while preserving X11 forwarding requires a bit of extra effort: not only must you ensure that the value of the DISPLAY variable is preserved, you must also make sure the target user has access to the contents of the ~/.Xauthority file of the source user. You can copy the ~/.Xauthority file to some other location (e.g. into /tmp) and then use the XAUTHORITY environment variable to point to it.



              For example:



              <logged in to remote host as user1, with X11 forwarding>
              user1$ echo $DISPLAY
              localhost:10.0
              user1$ cp ~/.Xauthority /tmp/user1.Xauthority
              user1$ chgrp user2 /tmp/user1.Xauthority
              user1$ chmod 640 /tmp/user1.Xauthority
              user1$ sudo -u user2 -i
              user2$ export DISPLAY=localhost:10.0
              user2$ export XAUTHORITY=/tmp/user1.Xauthority
              <now running a X11 GUI application should be possible>


              This can be often avoided when you're switching from regular user to root, since root can read everyone's files... including the ~/.Xauthority file. So when switching from user1 to root the only things that need to be done is to maintain the DISPLAY value and point XAUTHORITY to /home/user1/.Xauthority. Some Linux distributions include scripts or PAM modules that do this for you automatically when switching from a regular user to root.






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                The DISPLAY value of localhost:10.0 indicates you're on a SSH-forwarded X11 connection, as you stated in the question. If you change the DISPLAY to :0.0, then you're saying you want the program to present its windows on the screen that is directly attached to the remote computer... and if you're not physically near it, that isn't going to be very useful.



                Direct rendering would require that the GUI application have direct access to the actual GPU that draws to your screen... which is of course impossible when the screen and the application are not in the same host.



                It looks like this application might be designed to be used only locally. If it cannot gracefully fall back to indirect rendering, it cannot be used over a remote X11 connection: direct rendering requires that the GPU that will actually do the drawing should be in the same computer as the application, and not separated from it by a network connection.



                If you're using a remote X11 connection with Xming or VcXsrv, then your OpenGL support levels depends primarily on what OpenGL levels your Xming or VcXsrv will support. Of course the remote computer also needs the appropriate OpenGL libraries present, but usually the package manager or the application installer takes care of that.



                When you're running it as a regular user, are you running as the user you logged in your X11-forwarding SSH connection, or have you switched to another user account on the remote host after logging in?



                Switching user accounts while preserving X11 forwarding requires a bit of extra effort: not only must you ensure that the value of the DISPLAY variable is preserved, you must also make sure the target user has access to the contents of the ~/.Xauthority file of the source user. You can copy the ~/.Xauthority file to some other location (e.g. into /tmp) and then use the XAUTHORITY environment variable to point to it.



                For example:



                <logged in to remote host as user1, with X11 forwarding>
                user1$ echo $DISPLAY
                localhost:10.0
                user1$ cp ~/.Xauthority /tmp/user1.Xauthority
                user1$ chgrp user2 /tmp/user1.Xauthority
                user1$ chmod 640 /tmp/user1.Xauthority
                user1$ sudo -u user2 -i
                user2$ export DISPLAY=localhost:10.0
                user2$ export XAUTHORITY=/tmp/user1.Xauthority
                <now running a X11 GUI application should be possible>


                This can be often avoided when you're switching from regular user to root, since root can read everyone's files... including the ~/.Xauthority file. So when switching from user1 to root the only things that need to be done is to maintain the DISPLAY value and point XAUTHORITY to /home/user1/.Xauthority. Some Linux distributions include scripts or PAM modules that do this for you automatically when switching from a regular user to root.






                share|improve this answer












                The DISPLAY value of localhost:10.0 indicates you're on a SSH-forwarded X11 connection, as you stated in the question. If you change the DISPLAY to :0.0, then you're saying you want the program to present its windows on the screen that is directly attached to the remote computer... and if you're not physically near it, that isn't going to be very useful.



                Direct rendering would require that the GUI application have direct access to the actual GPU that draws to your screen... which is of course impossible when the screen and the application are not in the same host.



                It looks like this application might be designed to be used only locally. If it cannot gracefully fall back to indirect rendering, it cannot be used over a remote X11 connection: direct rendering requires that the GPU that will actually do the drawing should be in the same computer as the application, and not separated from it by a network connection.



                If you're using a remote X11 connection with Xming or VcXsrv, then your OpenGL support levels depends primarily on what OpenGL levels your Xming or VcXsrv will support. Of course the remote computer also needs the appropriate OpenGL libraries present, but usually the package manager or the application installer takes care of that.



                When you're running it as a regular user, are you running as the user you logged in your X11-forwarding SSH connection, or have you switched to another user account on the remote host after logging in?



                Switching user accounts while preserving X11 forwarding requires a bit of extra effort: not only must you ensure that the value of the DISPLAY variable is preserved, you must also make sure the target user has access to the contents of the ~/.Xauthority file of the source user. You can copy the ~/.Xauthority file to some other location (e.g. into /tmp) and then use the XAUTHORITY environment variable to point to it.



                For example:



                <logged in to remote host as user1, with X11 forwarding>
                user1$ echo $DISPLAY
                localhost:10.0
                user1$ cp ~/.Xauthority /tmp/user1.Xauthority
                user1$ chgrp user2 /tmp/user1.Xauthority
                user1$ chmod 640 /tmp/user1.Xauthority
                user1$ sudo -u user2 -i
                user2$ export DISPLAY=localhost:10.0
                user2$ export XAUTHORITY=/tmp/user1.Xauthority
                <now running a X11 GUI application should be possible>


                This can be often avoided when you're switching from regular user to root, since root can read everyone's files... including the ~/.Xauthority file. So when switching from user1 to root the only things that need to be done is to maintain the DISPLAY value and point XAUTHORITY to /home/user1/.Xauthority. Some Linux distributions include scripts or PAM modules that do this for you automatically when switching from a regular user to root.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 24 at 10:39









                telcoM

                14.1k11842




                14.1k11842






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f233031%2froot-needed-to-launch-x11-application%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Accessing regular linux commands in Huawei's Dopra Linux

                    Can't connect RFCOMM socket: Host is down

                    Kernel panic - not syncing: Fatal Exception in Interrupt