Mailing List Archive

Open display error
Hi,

I get this message on the latest Debian potato for i386.

--> ssh -f localhost xterm
sb@localhost's password:
--> xterm Xt error: Can't open display:

That happens also when connecting to another linux box:

--> ssh -f box2 /usr/X11R6/bin/xterm
--> /usr/X11R6/bin/xterm Xt error: Can't open display:

The $DISPLAY is
:0.0 for box1
undefined for box2 after plain ssh connection

If I manually set DISPLAY in box2 to box1:0.0 then I can open
all the windows I like, provided I ``xhost +'' box1. There are two
problems with this:

1. box2 should set the DISPLAY by itself (how?)
2. I do not want to ``xhost +'' box1, as my email client (exmh) will
otherwise stop working.

Also, all my xterm proc do not appear under sshd in pstree.
How do I fix this?

Thank you.

Sergio
Re: Open display error [ In reply to ]
... I can connect with the following command:

> ssh -f box2 'setenv DISPLAY box1:0.0 ; /usr/X11R6/bin/xterm'

provided I trigger "xhost + box2" in box1. This makes the thing
authomatic, but I still the problems I mentioned in the previous
message (and exmh still does not work with that xhost setting).

Sergio
Re: Open display error [ In reply to ]
Do you have X11Forwarding turned on in both /etc/sshd_config and
~/.ssh/config? Try running both ssh and sshd in debug mode and see if
the output doesn't tell you something.

--
jim knoble
jmknoble@pobox.com

På 2000-Jan-26 klokka 17:37:17 +0000 skrivet Sergio Brandano:

: I get this message on the latest Debian potato for i386.
:
: --> ssh -f localhost xterm
: sb@localhost's password:
: --> xterm Xt error: Can't open display:
:
: That happens also when connecting to another linux box:
:
: --> ssh -f box2 /usr/X11R6/bin/xterm
: --> /usr/X11R6/bin/xterm Xt error: Can't open display:
:
: The $DISPLAY is
: :0.0 for box1
: undefined for box2 after plain ssh connection
:
: If I manually set DISPLAY in box2 to box1:0.0 then I can open
: all the windows I like, provided I ``xhost +'' box1. There are two
: problems with this:
:
: 1. box2 should set the DISPLAY by itself (how?)
: 2. I do not want to ``xhost +'' box1, as my email client (exmh) will
: otherwise stop working.
Re: Open display error [ In reply to ]
>Do you have X11Forwarding turned on in both /etc/sshd_config and
>~/.ssh/config? Try running both ssh and sshd in debug mode and see if
>the output doesn't tell you something.
>
>jim knoble

I have no error messages on the debug, as far as I can see.

On /etc/ssh/sshd_config I have:

> X11Forwarding yes

and I remember it was the first thing I did some days ago.
I do not have ~/.ssh/config, but I found /etc/ssh/ssh_config
where ForwardX11 was not active. I created the ~/.ssh/config
where I allowed box2 as possible host:

Host box2
ForwardAgent yes
ForwardX11 yes

As a result

- --> ssh -f xterm

now works as it should (DISPLAY is set to box1:10.0
and, obviously, there are no problems concerning xhost).
(The debug trace was fine too.)

The following still does not work:

- --> ssh -f box2 /usr/X11R6/bin/xterm
- --> _X11TransSocketINETConnect: Can't connect: errno = 111
_X11TransSocketINETConnect: Can't connect: errno = 111
_X11TransSocketINETConnect: Can't connect: errno = 111
_X11TransSocketINETConnect: Can't connect: errno = 111
_X11TransSocketINETConnect: Can't connect: errno = 111
_X11TransSocketINETConnect: Can't connect: errno = 111
/usr/X11R6/bin/xterm Xt error: Can't open display: box2:10.0

I see it created DISPLAY automatically, but in the wrong way.
Instead of box2:10.0, it should open box1:10.0.
(the debug trace was dead.)

Sergio
Re: Open display error [ In reply to ]
On Thu, Jan 27, 2000 at 11:07:19AM +0000, Sergio Brandano wrote:
> - --> ssh -f box2 /usr/X11R6/bin/xterm
> - --> _X11TransSocketINETConnect: Can't connect: errno = 111
> _X11TransSocketINETConnect: Can't connect: errno = 111
> _X11TransSocketINETConnect: Can't connect: errno = 111
> _X11TransSocketINETConnect: Can't connect: errno = 111
> _X11TransSocketINETConnect: Can't connect: errno = 111
> _X11TransSocketINETConnect: Can't connect: errno = 111
> /usr/X11R6/bin/xterm Xt error: Can't open display: box2:10.0
>
> I see it created DISPLAY automatically, but in the wrong way.
> Instead of box2:10.0, it should open box1:10.0.
> (the debug trace was dead.)

no it should try box2:10.0.
i still can see no debugging output.
Re: Open display error [ In reply to ]
>no it should try box2:10.0.
>i still can see no debugging output.

Why? box1 is my machine (where I expect to see the window),
and box2 is the remote.

Sergio
Re: Open display error [ In reply to ]
The way forwarding works is this:

ssh (client) run on 'smallbox' is asked to connect to 'bigbox'. It
looks at /etc/ssh/ssh_config then at the ~/.ssh/config file
(allowing the latter to override the former's defaults).

It connects to 'bigbox'.

If ssh (client) has X forwarding enabled, it tries to open an
encrypted tunnel from smallbox:0.0 to bigbox:10.0. (If this is
used, it tries :11 etc). This will only work if bigbox allows X
forwarding (it looks in /etc/ssh/sshd_config). Assuming bigbox
lets it have bigbox:10.0, the connection has $DISPLAY set to
bigbox:10.0.

If in this new window, you run 'xterm', it makes a connection with
bigbox:10.0 which is tunnelled through to smallbox's display.

Disclaimer: I'm not very familiar with SSH internals so this is
just partially-educated guesswork.

Cheerio,

Andrew Stribblehill
Systems Programmer, IT Service, University of Durham, England
Re: Open display error [ In reply to ]
Problem solved!
It was the server ...

Thank you.
Sergio