Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
05-16-2004, 12:35 PM
|
#1
|
Member
Registered: Feb 2004
Location: Argentina
Distribution: Fedora Core
Posts: 34
Rep:
|
Gtk-WARNING **: cannot open display
This time, when I tried to open gedit logged in as root (su)
appears this error message:
Quote:
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
(gedit:10762): Gtk-WARNING **: cannot open display:
|
Does anybody know why?
|
|
|
05-16-2004, 01:48 PM
|
#2
|
Member
Registered: Oct 2003
Location: Florida
Distribution: Slackware
Posts: 273
Rep:
|
Because you su'ed to root. When you tried to run the program as root it tried to open up another X server while you already had one on that display. Why do you have to run it as root?
-Hope this helps. 
|
|
|
05-16-2004, 07:54 PM
|
#3
|
Senior Member
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088
Rep:
|
As root, try:
/usr/X11R6/bin/xhost +
This should enable you to connect to the X-display as root
--Ian
|
|
|
05-17-2004, 10:26 AM
|
#4
|
Member
Registered: Feb 2004
Location: Argentina
Distribution: Fedora Core
Posts: 34
Original Poster
Rep:
|
Quote:
Originally posted by IBall
As root, try:
/usr/X11R6/bin/xhost +
This should enable you to connect to the X-display as root
--Ian
|
Thank you, it worked !!!
|
|
|
07-25-2005, 02:05 PM
|
#5
|
Member
Registered: Oct 2004
Location: /usr/home
Distribution: Mint, Ubuntu server, FreeBSD, Android
Posts: 362
Rep:
|
How to make it permanent?
Quote:
Originally posted by IBall
[B]As root, try:
/usr/X11R6/bin/xhost +
|
Thanks for posting this information. I found while searching on this very problem.
One question: it only works for the current session. I do I make it stick across logins?
TIA
|
|
|
11-18-2009, 06:05 AM
|
#6
|
LQ Newbie
Registered: Nov 2009
Posts: 1
Rep:
|
Just dun use it when you are root...
use shell> sudo gedit <filename>
|
|
|
11-18-2009, 06:38 AM
|
#7
|
Member
Registered: Oct 2008
Location: Poland, Łódź
Distribution: Lubuntu, Salix
Posts: 105
Rep:
|
Quote:
Originally Posted by Kropotkin
One question: it only works for the current session. I do I make it stick across logins?
TIA
|
create .bashrc or .bash_login file in your home directory (if one of them exists just append to it) and add this line to it
Code:
xhost +si:localuser:root
save file and symlink .bashrc to .bash_login or vice-versa. From now on you allow root run X applications
|
|
|
01-25-2011, 09:39 PM
|
#8
|
LQ Newbie
Registered: Jan 2011
Posts: 2
Rep:
|
JMeter Install Failed (.:17510): Gtk-WARNING **: cannot open display:
Hi,
I have a problem installing JMeter on a linux
Enterprise Linux Enterprise Linux Server release 5.4 (Carthage)
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
java -version
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-46)
[root@<server> bin]# sh jmeter.sh
(.:18532): Gtk-WARNING **: cannot open display:
[root@msdvml62 bin]#
Also I do not have xhost in /usr/X11R6/bin/
Can someone help ?
|
|
|
01-25-2011, 10:18 PM
|
#9
|
Senior Member
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,860
|
Quote:
Originally Posted by IBall
As root, try:
/usr/X11R6/bin/xhost +
This should enable you to connect to the X-display as root
--Ian
|
It also allows anyone else who can reach your machine via tcp/ip to access your keyboard and display. Great for grabbing keystrokes!
|
|
|
01-25-2011, 11:36 PM
|
#10
|
LQ Newbie
Registered: Jan 2011
Posts: 2
Rep:
|
Hi Ian,
Thanks for your help, I got the following.
[root@<server> bin]# /usr/X11R6/bin/xhost +
-bash: /usr/X11R6/bin/xhost: No such file or directory
[root@<server> bin]#
Does that mean I am missing some patches?
I am a QA lead actually and got this Linux VM from my administrator.
Googling around seems to suggest that I don't have X System installed in the Linux.
I am wondering if that is the reason why I got the error when running jmeter.sh ?
Hopefully someone have encountered this before and fix it
Cheers
Peter
Last edited by peterlck; 01-26-2011 at 12:15 AM.
|
|
|
01-25-2011, 11:59 PM
|
#11
|
Senior Member
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467
Rep: 
|
Just try the command without the path - ie: xhost +local:
Oh, also that command needs to be run by the normal user who is logged into X, not by root.
Last edited by dive; 01-26-2011 at 12:07 AM.
|
|
|
01-28-2013, 11:43 AM
|
#12
|
LQ Newbie
Registered: Jan 2013
Posts: 1
Rep: 
|
I'm using CentOS and I was getting the same error, except when I disabled the network (clicking on the icon in the top right corner and clicking 'disconnect'), it worked fine. But then when I re-enabled the network again, I get the same error.
|
|
|
12-10-2013, 04:24 PM
|
#13
|
Member
Registered: Dec 2013
Location: Spain is pain!
Distribution: linux mint 17 cinnamon 32-bit
Posts: 30
Rep: 
|
Hi, I'm quite newby and I would like to know if you could tell me how to symlink .bashrc to .bash_login?
thank you
|
|
|
12-11-2013, 02:22 AM
|
#14
|
Senior Member
Registered: Feb 2009
Posts: 1,727
|
try kdesu, or the gtk equivalent
I think this programs exist exalty for the reason to not have to mess around with xhost
|
|
|
12-11-2013, 03:46 AM
|
#15
|
Member
Registered: Oct 2013
Distribution: Debian Sid, Gentoo, Arch, Debian
Posts: 186
Rep:
|
This problem also happens with me, when I am running KDE.
sudo somegtkapp
gives same error.
Although this doesn't happen when
gksudo somegtkapp
or
kdesudo somegtkapp
or
I start GNOME or fluxbox/openbox/lxsession etc.
|
|
|
All times are GMT -5. The time now is 08:55 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|