LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 08-17-2002, 03:51 AM   #1
dack_x
LQ Newbie
 
Registered: Jul 2002
Posts: 8

Rep: Reputation: 0
"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.
 
Old 08-17-2002, 04:41 AM   #2
NSKL
Senior Member
 
Registered: Jan 2002
Location: Rome, Italy ; Novi Sad, Srbija; Brisbane, Australia
Distribution: Ubuntu / ITOS2008
Posts: 1,207

Rep: Reputation: 46
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
 
Old 08-17-2002, 04:06 PM   #3
dack_x
LQ Newbie
 
Registered: Jul 2002
Posts: 8

Original Poster
Rep: Reputation: 0
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.
 
Old 08-18-2002, 12:30 AM   #4
dack_x
LQ Newbie
 
Registered: Jul 2002
Posts: 8

Original Poster
Rep: Reputation: 0
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
 
Old 08-18-2002, 04:28 AM   #5
NSKL
Senior Member
 
Registered: Jan 2002
Location: Rome, Italy ; Novi Sad, Srbija; Brisbane, Australia
Distribution: Ubuntu / ITOS2008
Posts: 1,207

Rep: Reputation: 46
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
 
Old 11-03-2007, 12:49 PM   #6
werner1975
Member
 
Registered: Jun 2007
Posts: 43

Rep: Reputation: 15
Hello, I tried it but I get:
Code:
xhost +: Unable to open display localhost:0.0
How can I open a gtk application using sudo?
Thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gtk-WARNING **: cannot open display iamjoepesci Red Hat 2 10-17-2008 11:51 AM
Gtk-WARNING **: cannot open display elfoozo DamnSmallLinux 3 07-12-2007 09:41 PM
Gtk-warning **: Cannot Open Display: davikevi Programming 3 02-18-2005 11:42 PM
Gtk-WARNING **: cannot open display: Larsin Linux - Software 1 02-25-2004 10:47 AM
"GTK-warning**: Cannot open display" Leon S. Kennedy Linux - Newbie 1 07-21-2003 03:05 AM


All times are GMT -5. The time now is 07:11 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration