Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Aug 15, 2003 6:05 pm 
Offline
Newbie

Joined: Fri Aug 15, 2003 4:12 pm
Posts: 3
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


Top
   
 Post subject:
PostPosted: Fri Aug 15, 2003 6:10 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
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


Top
   
 Post subject: tried that
PostPosted: Fri Aug 15, 2003 6:31 pm 
Offline
Newbie

Joined: Fri Aug 15, 2003 4:12 pm
Posts: 3
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 suggests it may be a debian bug, but if you have any other idea I'm all ears.

Thanks,
JDH


Top
   
 Post subject:
PostPosted: Fri Aug 15, 2003 6:41 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
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


Top
   
 Post subject:
PostPosted: Sat Aug 16, 2003 3:40 am 
Offline
Senior Newbie

Joined: Wed Jul 02, 2003 6:46 am
Posts: 13
Location: UK
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 :-))


Top
   
 Post subject: eureka!
PostPosted: Sat Aug 16, 2003 12:54 pm 
Offline
Newbie

Joined: Fri Aug 15, 2003 4:12 pm
Posts: 3
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


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group