running x server on minimal distribution

I have installed the debian minimal distribution and am adding packages as I need them. I would like to run X applications on the linode (eg, xterm) using ssh forwarding. I have configured the ssh daemon to automatically forward X11 and restarted it. I have installed the debian xfree86-server.

Normally with ssh and X11 forwarding I do not need to set the DISPLAY variable or anything, it just happens automagically.

On the linode, when I try and launch xterm, I get

/usr/X11R6/bin/xterm Xt error: Can't open display:

Not sure how to proceed from here. Does some X daemon need to be started up? I wouldn't know how to go about setting a DISPLAY var because the X client I am using is behind a NAT'd firewall. As I say, normally with X forwarding this is not a problem and I don't have to set

the DISPLAY variable, so I suspect it's a configuration problem.

At first I though X needed to be running on the server, but now am not so sure. On one of my boxes here on the LAN, I can launch X apps from the server even if I take the server down to runlevel 3 and X is not running on the server end as revealed by a ps aux|grep X.

I have read elsewhere that X does not need to be running to server X apps. Is this correct?

Any ideas for me?

Thanks,

JDH

5 Replies

If you are just ssh'ing into your Linode and then trying to launch x apps, I am pretty sure you'll need to set the DISPLAY environment variable. If your display isn't the Linode itself, then X won't need to be running (on the Linode).

You might be interested in your sshd_conf file – look for "X11Forwarding no". That might have something to do with accessing not from a login shell.

Try that….

-Chris

Yep, I had already those

(none):~# grep X /etc/ssh/sshd_config

X11Forwarding yes

X11DisplayOffset 10

(none):~# grep X /etc/ssh/ssh_config

ForwardX11 yes

The X11DisplayOffset 10 rang a bell, so I set

setenv DISPLAY localhost:10.0

but got the same error. On another remote linux box I have ssh access to, this is the value of DISPLAY and X11 forwarding is working so I think it's right. Unfortunately, I can't set the DISPLAY to my actual IP because I am behind a NAT'd firewall here. I've also disabled host control on the client with xhost +.

This link http://lists.debian.org/debian-user/200 … 00250.html">http://lists.debian.org/debian-user/2003/debian-user-200305/msg00250.html suggests it may be a debian bug, but if you have any other idea I'm all ears.

Thanks,

JDH

Here is a long shot, but make sure your hostname is set correctly.

I'm probably way off here, but lots of things complain without hostname being set.

-Chris

If you connect verbose does it tell you about anything failing regarding X:

ssh -X -v [username]@[hostname]

(Not sure if there is an equivalent on windows SSH clients?)

Also, when connected, does DISPLAY actually get set to anything:

echo $DISPLAY

(I can't try it at the moment but if I remeber correctly sshd normally sets this to the forwarded display on connection)

Last thing (the long shot) are you overriding the DISPLAY variable by setting it to anything manually in .bashrc/.profile/.bash_profile/whatever (that's the sort of thing I do and forget I did it :-))

Thanks caker and qbatqbat, both of you provided part of the solution.

When I did ssh -X -v user@ip I saw the message

debug1: Remote: No xauth program; cannot forward with spoofing.'

so the problem was that xauth wasn't in the minimal distribution. This was an easy fix

apt-get install xbase-clients

After that, the DISPLAY var was automatically and correctly set by ssh to 'localhost:10.0', but then I got a new error when I tried to launch an X app

_X11TransSocketINETConnect: Can't get address for localhost

/usr/X11R6/bin/xterm Xt error: Can't open display: localhost:10.0

This rang a bell with caker's suggestion to make sure the host info was right, and I checked /etc/hosts and it was empty. Adding

127.0.0.1 localhost.localdomain localhost

to that file fixed my problems.

Perhaps the minimal debian distribution should have localhost in /etc/hosts by default?

Thanks all,

John Hunter

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct