LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 06-26-2005, 09:25 PM   #1
zero79
Member
 
Registered: Nov 2003
Location: Ohio
Distribution: Debian Unstable
Posts: 460

Rep: Reputation: 30
Question how to launch apps in a new x display?


i'm trying to launch an application in a new x display. i do

Code:
xinit xterm -- :1
the server is launched, but xterm is not started and i keep getting the following error in the terminal that i launched the command from

Code:
AUDIT: Sun Jun 26 17:19:18 2005: 16651 X: client 1 rejected from local host
Xlib: connection to ":1.0" refused by server
Xlib: No protocol specified
it's like there is some configuration file that is preventing applications from connecting to x servers other than the default :0

if anyone has any thoughts, it would be greatly appreciated.
 
Old 06-26-2005, 10:34 PM   #2
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
Well, for starters, the xinit syntax is a tad odd. So, everything you give as a parameter, is given to the xterm as a parameter, so giving xterm xterm doesnt make much sense (:

Code:
xinit -- :1
If you do just that, does it work?

If you want something else to run other than the xterm, you could allways use:
Code:
xinit -e appcommand -- :1
And btw, what is this Audit that reports on the problem?
 
Old 06-27-2005, 10:33 PM   #3
zero79
Member
 
Registered: Nov 2003
Location: Ohio
Distribution: Debian Unstable
Posts: 460

Original Poster
Rep: Reputation: 30
hi, thanks for the suggestion. i tried

Code:
xnit -e xterm -- :1
on three separate Debian Sarge systems and get the same error:

Code:
AUDIT: Sun Jun 26 17:19:18 2005: 16651 X: client 1 rejected from local host
Xlib: connection to ":1.0" refused by server
Xlib: No protocol specified
even if i do

Code:
xinit -- :1
i get the same error (but like i said before, the x server does start, and i have the x cursor and checkered screen, just no apps).

i think the key error message is "X: client 1 rejected from local host", which is saying that it's not allowing client programs (such as xterm) to connect to server :1 i think. does Debian have some sort of security setting that only allows connections to server :0 by default?

thanks again for any thoughts.

Last edited by zero79; 06-27-2005 at 10:35 PM.
 
Old 06-28-2005, 03:40 AM   #4
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
Hmmmm.... Interesting.. I woudnt wonder for a second if debian indeed had one, but if it hasm theres got to be a way around it for usabilitys sake.

Perhaps it could work if you set the DISPLAY variable, and xhost the screen, but thats a tad tricky to do, well, lets try.. (;

(Oh and to clarify my previous mambojumbo about the xinit syntax, Ill try to clarify that: xinit allways launches an xterm by default, so by typing xinit -e xterm you would actually be telling xinit to start an xterm that will start an xterm.. (; What parameters you give xinit before the --, will go to the default xterm.)

Code:
#!/bin/bash

xinit -- :1 &
export DISPLAY=:1
xhost localhost
xterm &
And to explain it a tad:
First we start the X server. (if you dont specificly need xinit, also 'X :1' would do about the same, with less the errors.. (
Then we change the display variable so xhost will look at the correct screen.
Then we give the screen accessrights from localhost, and start an xterm there..
 
Old 06-28-2005, 11:27 AM   #5
zero79
Member
 
Registered: Nov 2003
Location: Ohio
Distribution: Debian Unstable
Posts: 460

Original Poster
Rep: Reputation: 30
Still no luck. Here's what I do and the messages I get:

Code:
$ X :1 &
$ xhost +localhost
localhost being added to access control list
$ DISPLAY=:1 xterm
AUDIT: Tue Jun 28 11:05:39 2005: 4789 X: client 1 rejected from local host
Xlib: connection to ":1.0" refused by server
Xlib: No protocol specified

xterm Xt error: Can't open display: :1
Note that I can execute the above commands as root and get the same errors!?

Last edited by zero79; 06-28-2005 at 11:34 AM.
 
Old 06-28-2005, 11:53 AM   #6
zero79
Member
 
Registered: Nov 2003
Location: Ohio
Distribution: Debian Unstable
Posts: 460

Original Poster
Rep: Reputation: 30
ok, i must have messed up the X configuration on each of these machines somehow...

i removed the .Xauthority file, and all seems to work well now

Code:
mv ~/.Xauthority ~/.Xauthority.old
 
Old 06-28-2005, 11:22 PM   #7
zero79
Member
 
Registered: Nov 2003
Location: Ohio
Distribution: Debian Unstable
Posts: 460

Original Poster
Rep: Reputation: 30
ok, so this is weird. when i log out and back in, i get the errors when i do

Code:
$ xinit -- :1
but if i remove the ~/.Xauthority file, i can execute the above command just fine. as an aside, if i look at

Code:
$ xauth list
i see that by default displays :0 and :10 are authorized, so i can use

Code:
$ xinit -- :10
at any time and the second X display will work at any time.

so, how do i add display :1 to xauth? thanks.

Last edited by zero79; 06-28-2005 at 11:27 PM.
 
Old 06-29-2005, 05:40 AM   #8
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
acording to the xauth manpage, xdm / gdm / kdm is the one that recreates Xauthority on every graphical login.. So, rummaging thhrough the config of the one you use might be a worthy idea..
 
Old 06-29-2005, 10:58 PM   #9
zero79
Member
 
Registered: Nov 2003
Location: Ohio
Distribution: Debian Unstable
Posts: 460

Original Poster
Rep: Reputation: 30
ok, i got this figured out. i need to allow client connections to the new screen via the xauth utility. the syntax is

Code:
$ xauth add :1 . e35a4dd7ad107110869f6972fa8326ac
$ xinit -- :1
where the long string is a user-chosen/random set of 32 hexadecimal characters that uniquely identify the new display (this is the value that is passed to remote client applications that will be served on this display).

thanks for all the help. peace.

Last edited by zero79; 06-30-2005 at 10:04 AM.
 
  


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
way to *click* launch apps slackwarebilly Linux - General 10 07-27-2005 12:11 PM
key combinations to launch apps? will103 Linux - Software 2 09-11-2004 03:55 PM
Menu troubles: apps do not launch; unable to add apps hfinger Mandriva 1 08-22-2003 05:49 AM
Automatically Launch apps. with Fluxbox ganninu Linux - Software 1 08-17-2003 01:29 PM
Can't launch X apps when 'su'd as another user davee Linux - Newbie 3 08-17-2003 12:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 06:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration