Upon bootup, how do I do an "xhost + machine" without using a terminal window?

Mikkel L. Ellertson mikkel at infinity-ltd.com
Sun Apr 30 17:13:28 UTC 2006


Gilbert Sebenste wrote:
> Hello all,
> 
> One more question for the gurus this morning, which I couldn't get an
> answer to earlier.
> 
> I want to start up some programs that require the use of X window :2.
> Unfortunately, to do that, I have to physically be at the machine and on
> a terminal window, type:
> 
> xhost + something.something.com
> 
> Which would then allow all X processes to run from that machine.
> But I want to do it automatically upon bootup. I tried to do this in
> /etc/rc.d/rc.local, but it gives me:
> 
> xhost:  unable to open display ""
> 
> OK. So how do I solve this?
> 
> Thank you very much for any help,
> 
> Gilbert
> 
xhost only runs under X, and has to be run on the X server you want
to change access for. That is why you get the error.

There are a couple of ways around this. Probably the least secure
way would be to add it to /etc/X11/xinitd/xinitrc-common. The
problem here is that it will allow any program on
something.something.com to connect to any X server running on that
machine.

A better way would be to use ssh to start the program on the other
machine with X tunneling. That way, you are sure only the programs
you want to run can access the X server.

There are also some things you can do with xauth, but I don't
understand it well enough to explain it to someone else.

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!




More information about the users mailing list