Operating System - HP-UX
1820140 Members
3329 Online
109619 Solutions
New Discussion юеВ

Xterm Xt Error: Can't open display: %s

 
baong
Frequent Advisor

Xterm Xt Error: Can't open display: %s

Hi All,
I installed Cygwin/X on my window XP, and using ssh to log into HPUX machine. here is the output:
# DISPLAY=IP:0.0 (IP which is my IP on window)
#export DISPLAY
#echo $DISPLAY
192.168.1.23:0.0
#xterm &
[1] 2945
#xterm Xt error: Can't open display: %s
[1] + Done<1>
# uname -a
HP-UX colorado B.11.23 U ia64 0851103349 unlimited-user license
# ps -ef | grep sshd
root 987 1 0 Feb 12 ? 0:00 /opt/ssh/sbin/sshd
root 3130 10510 1 10:15:39 console 0:00 grep sshd
root 1299 987 0 09:09:04 ? 0:00 sshd: root@pts/1
root 994 987 0 09:00:18 ? 0:00 sshd: root@pts/0
Do i have to config anything in file /opt/ssh/etc/sshd_config ?
# ssh -V
OpenSSH_4.5p1+sftpfilecontrol-v1.1-hpn12v14, OpenSSL 0.9.7l 28 Sep 2006
HP-UX Secure Shell-A.04.50.021, HP-UX Secure Shell version
on my PC i tried to run command xhost +
xhost: unable to open display

Any input from you guys or suggestion i really appreciate it.
9 REPLIES 9
Steven Schweda
Honored Contributor

Re: Xterm Xt Error: Can't open display: %s

> on my PC i tried to run command xhost +
> xhost: unable to open display

> I installed Cygwin/X on my window XP [...]

Did you _start_ the X server after you
installed it? (If the Windows system can't
find its own X server, how do you expect
some other system to find it?)


> [...] using ssh [..]

> # DISPLAY=IP:0.0 (IP which is my IP on window)
> #export DISPLAY

Wouldn't it make more sense to use the X
forwarding capability in SSH?
Steven E. Protter
Exalted Contributor

Re: Xterm Xt Error: Can't open display: %s

Shalom,

Your version of Openssh is fine. It will work in this scenario.

On the PC, you might want to open a cmd window and run:

netstat -an

Let's confirm that the cygwin is listening and whether it is listening on the same IP/socket as your DISPLAY variable is pointing to.

192.168.1.23:0.0
Is your diplay. From Unix make sure you can ping it, basic network connectivity is up.

Consider logging in to Unix as follows:

ssh -X hostname/ip_address (of Unix)

Use xclock command to test GUI functionality

SEP

Basically your X server on the PC needs to listen on the IP address and number (after the colon) as the DISPLAY variable.

The basic install of Cygwin/X does not include the X server. The interface is confusing and you have to install optional software to make this work.

Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven Schweda
Honored Contributor

Re: Xterm Xt Error: Can't open display: %s

> Basically your X server on the PC needs to
> listen on the IP address and number (after
> the colon) as the DISPLAY variable.

The X port number is normally 6000 + the
server/display number (the first number
after the colon).

http://x.cygwin.com/docs/faq/cygwin-x-faq.html
baong
Frequent Advisor

Re: Xterm Xt Error: Can't open display: %s

Steven Schweda,
I dont see no port 6000+ listening on my PC at all, is that mean my X server had not start yet?? how do you start up your X server on PC side...I am beginer to learn become unix sys admin..please provide me step by step..
Thanks so much
Torsten.
Acclaimed Contributor

Re: Xterm Xt Error: Can't open display: %s

I prefer something smaller than Cygwin for this, e.g. xming.

IIRC you need to allow access "xhosts +" after starting X.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
baong
Frequent Advisor

Re: Xterm Xt Error: Can't open display: %s

Here is my output on HPUX machine:
# uname -a
HP-UX colorado B.11.23 U ia64 0851103349 unlimited-user license
# DISPLAY=192.168.1.23:0.0
# export DISPLAY
# xclock &
[1] 7889
# Xlib: connection to "192.168.1.23:0.0" refused by server
Xlib: No protocol specified

Error: Can't open display: 192.168.1.23:0.0
Error: Couldn't find per display information

[1] + Done(1)

Here is the output from XP window
$ xhost +
access control disable, clients can connect from any host
Torsten.
Acclaimed Contributor

Re: Xterm Xt Error: Can't open display: %s

I'm really not sure if this is :0.0 or something else. Unfortunately I can't remember the details, but there was something special with cygwin/X.

Try this simple solution: Start xming on your PC, run putty -X and you are done.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
baong
Frequent Advisor

Re: Xterm Xt Error: Can't open display: %s

Thanks all the answer and suggestion to me..I got it soloved it...
I start on my pc startxwin
$ xhost +
on my HPUX i ssh -X hostname and setup my display
DISPLAY=IP-PC:0.0
export DISPLAY
#xterm &
is working fine...thanks so much all..
Steven Schweda
Honored Contributor

Re: Xterm Xt Error: Can't open display: %s

> [...] I am beginer to learn become unix sys
> admin..please provide me step by step..

But this is actually a Windows problem
(about which I know approximately nothing).

> # Xlib: connection to "192.168.1.23:0.0" refused by server

"Connection refused" normally means that the
server is not running (or configured to run).

> on my HPUX i ssh -X hostname and setup my display
> DISPLAY=IP-PC:0.0
> export DISPLAY

If you say "ssh -X", then SSH should do all
the work, and you should not need to set
DISPLAY. And if you do set it this way, then
the X traffic will not be encrypted by the
SSH software.

man ssh # (On the client system.)

If you don't encrypt the X traffic, then you
would seem to be opening a significant
security hole. Using SSH for only some of
your data may let you think that you have
better security than you really have.