Announcement

Collapse
No announcement yet.

gui apps with sudo (e.g. synaptic) suddenly can't find display

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    gui apps with sudo (e.g. synaptic) suddenly can't find display

    Hi,
    just recently (possibly after installing an nvidia update from x swat, whenever I try to launch an app requiring root access (via sudo), the apps will not start. If for example I try to start synaptic from the kde menu, it will ask for credentials (to sudo) like normal, then fail to launch. I can't stand muon (that app makes managing apps like fixing a watch with oven mitts on) so this is troubling for me. When I try to launch 'kate' with sudo on the command line (e.g. mymachine\> sudo kate), once I enter the password I am given this message:

    Code:
    me@mud:~$ sudo kate
    [sudo] password for me: 
    No protocol specified
    kate: cannot connect to X server :0
    me@mud:~$
    I have tried sudo -E, and it doesn't help. But really I shouldn't have to since I didn't need to up until a day ago. And I never had a problem with synaptic before which is launched from the kde menu. It also affects a kde file search program I launch from the menu as well that I have set up for superuser mode (i.e. root privilege for searching). And that always worked without requiring extra mojo.

    Can someone let me know where I need to look and what it should look like so that programs launched with sudo will be 'x' enabled again.

    It seems obvious that some configuration was messed up, I would like to figure out what it was.

    Thanks in advance,

    tsmc

    #2
    First, don't use sudo to launch a graphical application. Use kdesudo instead. So, try kdesudo kate and see what happens.
    Last edited by Snowhog; Mar 28, 2012, 08:49 PM.
    Using Kubuntu Linux since March 23, 2007
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      No difference. The configuration allowing sudo to work with X seems to have been pooched. Any insight on where to look for that?

      Comment


        #4
        In a terminal, if you enter xhost + <enter> and then enter your sudo command, does it work? If so, it is a problem with the xserver access control. If it works, that's not a good solution, it just leads to other things to check.

        EDIT: If it does work, then there is probably a problem with your hostname or /etc/hosts file.
        Last edited by vw72; Mar 28, 2012, 08:56 PM.

        Comment


          #5
          Originally posted by vw72 View Post
          EDIT: If it does work, then there is probably a problem with your hostname or /etc/hosts file.
          Funny you should say that. I had just thought about the xhost command but remembered that I had changed the hostname in the hostname file. Actually I removed it. Anyway I put the hostname back in the hostname file and voila! It works again. But I will start using kdesudo instead of just sudo. I did learn that much. I think the name was doing some mojo to my glassfish appserver services (or it might have been I'll find out when I go to try it again). I had added my real ip address and paired it with my host name in the hosts file so that I could do some unit testing on some JEE apps I am writing. It seemed like there was some conflict the way I have it set up that was doing something screwy to the app server. One of those quick fixes that isn't all that quick in the end.

          I commented out the line line in hosts with 127.0.1.1 muddy (muddy is my host name). That definitely was screwing up some of the services in glassfish. Anyway I'll sort those out later. In the meantime this works again.

          What do I need to do if I want to safely remove the hostname from the hostname file? (Seeing as we are already talking about it!)

          Thanks for the replies and insight.

          BillR
          Last edited by theshowmecanuck; Mar 28, 2012, 09:22 PM.

          Comment


            #6
            You shouldn't have to comment out the 127.0.1.1 entry. I don't use glassfish, but if there is a conflict, from what I read, there is probably something else that is not quite configured correctly. To change your hostname, I believe you have to change it in both /etc/hosts and /etc/hostname.

            Comment


              #7
              I know its solved but from http://www.debian.org/doc/manuals/re...html#s-net-dns we can get:

              Some software (e.g., GNOME) expects the system hostname to be resolvable to an IP address with a canonical fully qualified domain name. This is really improper because system hostnames and domain names are two very different things; but there you have it. In order to support that software, it is necessary to ensure that the system hostname can be resolved. Most often this is done by putting a line in /etc/hosts containing some IP address and the system hostname. If your system has a permanent IP address then use that; otherwise use the address 127.0.1.1.
              So, if you have a permanent ip try to use it instead of comenting it.

              Comment

              Working...
              X