LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 10-27-2005, 04:45 PM   #1
nanjil
Member
 
Registered: Jul 2005
Posts: 70

Rep: Reputation: 15
xterm will not display


hello:

I have suse linux 10.0 installed in a machine. from that machine I rsh'd to my windows machine running cygwin.

I went through the usual procedure of setting display as the suse machine:0 and made sure to run xhost +.

but still i get the error message

xterm: can't open display

when I try to fire up a xterm in the remote machine

any ideas?
thanx
 
Old 10-28-2005, 12:25 PM   #2
Quigi
Member
 
Registered: Mar 2003
Location: Cambridge, MA, USA
Distribution: Ubuntu (Dapper and Heron)
Posts: 377

Rep: Reputation: 31
What is "the usual procedure of setting display"? The error looks like it is NOT set.

For security, I'd use ssh instead of rsh.

There are many other issues:
* suse_machine:0 expects X to listen on :6000 as in the old days. Mine (Xorg Release 6.7) doesn't. What do you get from "sudo /usr/sbin/lsof -i :6000-6020 -P -n" on Suse?
* Your firewall may block :6000
* xhost + (if it works at all) is dangerous.
* ssh fails to tunnel X11 to Cygwin (Anyone know why?)

I worked around them. Let us know your situation.
 
Old 10-28-2005, 07:34 PM   #3
nanjil
Member
 
Registered: Jul 2005
Posts: 70

Original Poster
Rep: Reputation: 15
the sudo command lsof returns with nothing for ports 6000-6020.

My firewall is disabled as well.
I double checked the DISPLAY variabel in the remote cygwin client and it is set correctly
 
Old 10-28-2005, 09:39 PM   #4
Quigi
Member
 
Registered: Mar 2003
Location: Cambridge, MA, USA
Distribution: Ubuntu (Dapper and Heron)
Posts: 377

Rep: Reputation: 31
As I said, normally you'd just "ssh otherhost", and all would working -- no need to xhost or set DISPLAY. But it doesn't work for Cygwin.

Your lsof result shows your X server acs like mine -- it's not listening. But you can use ssh's "normal" behavior to make it listen by logging in to a non-cygwin machine, e.g., localhost. There are two ways. One would actually make your DISPLAY environment variable work. The other seems a bit simpler.
 
Old 10-28-2005, 10:18 PM   #5
Quigi
Member
 
Registered: Mar 2003
Location: Cambridge, MA, USA
Distribution: Ubuntu (Dapper and Heron)
Posts: 377

Rep: Reputation: 31
Here's how you could do it. Call me devious, or better yet, tell me a simpler way
Code:
$ ssh localhost
quigi@localhost's password: not echoed
$ echo $DISPLAY
localhost:10.0
$ xauth l :10
susehost/unix:10  MIT-MAGIC-COOKIE-1  5ef1d2207b1be43321c4ea4e16df46bc
$ ssh cygwinhost -R6010:localhost:6010
quigi@cygwinhost's password: 

Last login: Fri Oct 28 13:27:33 2005 from susehost
$ export DISPLAY=localhost:10
$ xauth add :10  MIT-MAGIC-COOKIE-1  5ef1d2207b1be43321c4ea4e16df46bc
$ xclock or xterm or whatever
Obviously you'd substitute the real host names or IP addresses for "susehost" and "cygwinhost". After the first ssh, you can run lsof again, and you'll see
Code:
COMMAND   PID  USER   FD   TYPE  DEVICE SIZE NODE NAME
sshd    25193 quigi    9u  IPv4 2430800       TCP localhost.localdomain:6010 (LISTEN)
sshd    25193 quigi   10u  IPv6 2430801       TCP localhost:6010 (LISTEN)
Now ssh is listening! For display :10, it's port 6000+10. If you omit the -P option, you get "x11-ssh-offset" instead. And we forward this very port to the other machine.

Note that "xhost" is not necessary. The "xauth" scheme, which hinges on keeping the magic cookie secret, is more modern and safer. It was developed for X servers, but in this case, ssh, which acts as a proxy for your non-listening X server, will check it.

Last edited by Quigi; 10-28-2005 at 10:21 PM.
 
Old 10-28-2005, 11:07 PM   #6
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 51
Let me first get this clear, are you SSH'ing from Linux to Windows, or from Windows to Linux?

If it is the latter, in Cygwin, you need to first start the X server in order to get X. So you should first do "startx"; then you get an xterm. Then you can do "ssh -Y user@hostname", which is the correct way to forward X in OpenSSH (in Linux and other OSs), and don't do any xhost or change $DISPLAY or anything like that. (for older versions use "-X")

Last edited by spooon; 10-28-2005 at 11:10 PM.
 
Old 10-29-2005, 06:45 AM   #7
nanjil
Member
 
Registered: Jul 2005
Posts: 70

Original Poster
Rep: Reputation: 15
okay

I will try that method (trying to display cygwin xterm in suse linux machine)

To throguh more light, this is my situation

I used to be developing code in a windows/cygwin environment in a laptop

now my plan is to make the suse linux in a desktop as the main code development platform.

During this migration I have to periodically log on to the cygwin laptop. During this migration It is still convenient to do emacs etc over in the cygwin laptop, yet have it displayed in the suse linux.

Yes i have the cygwin xterm running

thanx for your time and help
 
Old 10-29-2005, 04:05 PM   #8
nanjil
Member
 
Registered: Jul 2005
Posts: 70

Original Poster
Rep: Reputation: 15
guys

I just figured out the problem. the ssh server was not setup to forward X11.

I modified sshd_conf and now my remote cygwin is forwarding the xsession

thanx
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
xterm - howto lauch an xterm into a specific directory jobano Linux - Software 11 01-30-2023 04:45 AM
can't display 'ö,ä,ü,ß' in xterm.. ichbinesderelch Linux - General 4 07-22-2014 08:17 AM
Help with xterm -display option squinn Linux - General 1 08-15-2005 06:11 PM
how is black xterm background in IceWM when issue a xterm command? BRAHmS Linux - Software 1 02-14-2005 03:51 AM
Xterm Error Not Able To Display ujnam Linux - Software 2 11-01-2004 06:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 05:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration