LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-18-2003, 10:38 AM   #1
Sin-D
LQ Newbie
 
Registered: Nov 2003
Location: The Netherlands
Distribution: Suse 9.0 professional
Posts: 14

Rep: Reputation: 0
can't run X11 programs from xterm


Heya,

I got a 'little' problem, often when i want to start a program through the terminal while being in X window system it can't open the GUI.

Then it gives the following error message:
Code:
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
Or with another program:
Code:
linux:/home/me # guarddog
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

guarddog: cannot connect to X server :0.0
However when i try to run the program from the kde menu it works fine.

Any ideas? Thank you

Suse linux 9.0 pro.
pentium4 3 ghz
512 mb ram
Asus P4P800
Ati Radeon 9800Pro 128 mb
 
Old 12-18-2003, 11:19 AM   #2
RolledOat
Member
 
Registered: Feb 2003
Location: San Antonio
Distribution: Suse 9.0 Professional
Posts: 843

Rep: Reputation: 30
Hmmm, are you doing an su to another user. It is pretty simple, as root, or user, before the
su, enter
xhost + localhost

This will allow other users to connect to the running user's X session.

R.O.
 
Old 12-18-2003, 11:29 AM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Tsk tsk tsk ;)

RolledOat, that's only half the story!
You'dhave to add export DISPLAY=localhost:0.0
in the respective shell, too ...

And then, xhost + is always a security risk.
The cleaner alternative is a local ssh connection.

ssh -X <otheruser>@localhost <program>


Cheers,
Tink

Last edited by Tinkster; 12-18-2003 at 11:30 AM.
 
Old 12-18-2003, 11:41 AM   #4
RolledOat
Member
 
Registered: Feb 2003
Location: San Antonio
Distribution: Suse 9.0 Professional
Posts: 843

Rep: Reputation: 30
Ahhh, tink, it was not saying 'unknown host/location'. It knew where to connect, just wasn't allowed to. Plus, adding localhost to xhost + is not that great a risk because only someone logged into localhost can connect to it. (If they had ssh/rsh, etc access, they would redirect to their local machine, which is a whole nother ball of wax).

I would agree that ssh is more secure, but did not want to overwhelm the poster. Besides, if the xhost + localhost
didn't work, with a new error, then I would get into export DISPLAY, etc.

R.O.
 
Old 12-18-2003, 11:55 AM   #5
Sin-D
LQ Newbie
 
Registered: Nov 2003
Location: The Netherlands
Distribution: Suse 9.0 professional
Posts: 14

Original Poster
Rep: Reputation: 0
thanks guys, both worked great
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sudo and X11 programs 65_289 Linux - Software 1 05-17-2005 08:42 PM
xterm or kconsole to run minicom tcma Linux - Software 2 09-20-2004 02:51 PM
x11 xterm Problem Cant get Xwin up likearock Slackware 7 03-07-2004 01:58 PM
Changing size of programs executed in xterm adz Linux - Software 4 09-14-2003 08:54 AM
Shortcut for xterm programs stwhite Linux - General 1 03-28-2001 02:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:28 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration