Subject: Re: Can't open display
To: None <oinkfreebiker@att.net>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-help
Date: 09/05/2001 18:58:32
> > # communicator
> > Error: Can't open display:

> The DISPLAY environmental variable needs to be set to point at your
> screen. 
> 
> In sh/ksh/bash, do something like:
> DISPLAY=your.hostname:0.0
> 
> Or csh/tcsh:
> setenv DISPLAY your.hostname:0.0
> 
> You'll also need to use xauth to give the remote machine access to your
> screen. 
> 
> Of course, if you are just running communicator on the machine you have
> your X server on then DISPLAY just needs to be set to ":0.0" (without the
> quotes). You shouldn't need xauth in that case.

You can also use xhost on the system running X to allow the remote client
app, for example:

  xhost +remote.host.name

But this allows any user at that remote host to connect.

In addition, if you are using ssh, you can use the the ForwardX11
directive. This will automatically setup the Xauthority data and DISPLAY
variable for you. Plus it will encrypt the X11 connection.

My ~/.ssh/config file has:

Host kids
   ForwardX11 yes

You can also do something like:
 ssh -v -o "ForwardX11 yes" reed@192.168.5.4

(The "X11Forwarding yes" will also need to be enabled for the ssh daemon,
but I think this is often the default.)

   Jeremy C. Reed
   http://www.reedmedia.net/