Operating System - HP-UX
1751714 Members
5723 Online
108781 Solutions
New Discussion юеВ

Re: Xwindow Problem - Can't open display: %s

 
SOLVED
Go to solution
ashutosh99
Frequent Advisor

Xwindow Problem - Can't open display: %s

Hi All,

 

I'm facing an error while trying to get a HP-UX GUI using Xwindow. here are the details:

system : HPVM with HP-UX 11i v3

xclient : XMing

I've started the xfs deamon and set the display vairable as well

 

# ps -ef|grep -i x11
root 7100 1 0 04:03:58 ? 0:00 /usr/bin/X11/xfs -config /etc/X11/fs/config -port 7000 -daemon -quiet_if_addrinuse
# env|grep -i dis
DISPLAY=localhost:0.0
# xterm
xterm Xt error: Can't open display: %s

 

I don't what's wrong and how to fix it. Any help is really appreciaed.

 

Thanks,

Ashutosh Singh

 

10 REPLIES 10
Torsten.
Acclaimed Contributor

Re: Xwindow Problem - Can't open display: %s

Maybe the variable is wrong. Not sure about your settings.

Try "mobaxterm" (X over ssh), works perfectly. Google it!

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!   
Dennis Handly
Acclaimed Contributor

Re: Xwindow Problem - Can't open display: %s

>DISPLAY=localhost:0.0

>Maybe the variable is wrong.

 

That would be my thought too.  I would have thought that is the location of the DISPLAY ON the server, not the PC.

When I use putty and ssh and xming, I get a variable like: localhost:##:0

Bill Hassell
Honored Contributor

Re: Xwindow Problem - Can't open display: %s

>> DISPLAY=localhost:0.0

 

Unless you are using a display, mouse and keyboard connected to the computer, this is not a valid setting. If you use Linux a lot (where the KVM is part of the computer), it is easy to make this mistake. The DISPLAY variable is used to tell Xwindows where to route the graphics. Since you mentioned Xming (which works quite well), you are probably using a PC as your display device. Therefore, the setting for DISPLAY must point to your PC, not the localhost:0.0 on the HP-UX system.

 

To set the DISPLAY variable automatically, run this command:

export DISPLAY=$(who -muR | awk '{print $NF}'):0.0"

What this does is (from the HP-UX side) to identify your PC's connection and set that  address as the DISPLAY variable.

 

Additionally, Xwindows is considered to be a network security risk so if your Xwindow data is flowing across routers, your company may block port 7000 which will prevent Xwindows from working except within a local subnet.

 

Also, Xwindows is only useful when displaying graphic images. If you are using it to login to HP-UX with xterm, that is a very cumbersome and network-intensive way to communicate. Download PuTTY and you'll eliminate all the issues with Xwindow connectivity.

 

 



Bill Hassell, sysadmin
Torsten.
Acclaimed Contributor

Re: Xwindow Problem - Can't open display: %s

As said, if you really need X, consider to tunnel via ssh.


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!   
ashutosh99
Frequent Advisor

Re: Xwindow Problem - Can't open display: %s

Thank you all for your valuable inputs.

 

I tried changing the display variable, but the problem presisted. I googled the problem and there were some directions reagrding the .Xauthority file being corrupt. I'm not sure what this file does and how to correct it. Maybe, if you guys have any ideas about the same, please let me know.

 

I'll try mobaxterm to see if it works for me.

 

And I know Xwindows is quite cumbersome, but I need to configure bastille in my environment and that can be only setup using GUI. So, I kind of need te GUI for the time being.

 

Thanks,

Ashutosh Singh

Torsten.
Acclaimed Contributor
Solution

Re: Xwindow Problem - Can't open display: %s

Yes, bastille need it ...

Run mobaxterm on your pc,  do ssh (sessions icon upper left corner, or just type ssh from the shell) to the server and start bastille.

 

This is cygwin in a single executable file, cool.


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!   
Dennis Handly
Acclaimed Contributor

Re: Xwindow Problem - Can't open display: %s

>To set the DISPLAY variable automatically, run this command:

 

You have too many "$(":

export DISPLAY=$(who -muR | awk '{print $NF}'):0.0"

 

(You can edit your post by Post Options > Edit Reply.)

Bill Hassell
Honored Contributor

Re: Xwindow Problem - Can't open display: %s

>> You have too many "$(":

 Yep. I fixed the line. Thanks.



Bill Hassell, sysadmin
Steven Schweda
Honored Contributor

Re: Xwindow Problem - Can't open display: %s