"Gtk-WARNING **: cannot open display: " when I su
I'm using GNOME2. When I su in terminal and enter a command for a program that uses gtk I get an error like this :
(gedit:8562): Gtk-WARNING **: cannot open display: What's the deal? Thanks. |
Since you started X with a different user than with who you are trying to run the program X is not allowing it (security)
Before you su type: xhost + or xhost + localhost then su and try to run the app again, it should work now Hope that helps -NSKL |
Thanks for the reply.
I entered the command, and it still doesn't work. Any other options or perhaps a configuration file that can be manually edited? Also perhaps I should note I am using a Linux From Scratch (LFS) system. Thanks. |
It seems that in addition to using xhost +localhost, using the command export DISPLAY=LOCALHOST:0.0 enables me to open applications that use gtk after suing. I used xhost +localhost as the original user, then after I su I set export DISPLAY=LOCALHOST:0.0
|
Yeah i knew about that, but for me i have to do that only if i ssh or telnet into another machine and try to run apps there. If i only su between local users i only need to issue xhost + with original user. I guess its different with LFS.
Thanks for the info anyway! -NSKL |
Hello, I tried it but I get:
Code:
xhost +: Unable to open display localhost:0.0 Thanks. |
All times are GMT -5. The time now is 04:20 PM. |