Operating System - Linux
1819899 Members
2560 Online
109607 Solutions
New Discussion юеВ

x display on Linux AS 4.0

 
Cliff Lim Kok Hwee
Regular Advisor

x display on Linux AS 4.0

Hi Forumer,

I login as user appuser locally and perform export DISPLAY=:0.0

But when running xclock it is prompting display not set.

But when i run remotely from my laptop and having software X CLIENT REFLECTION started and i perform the same export DISPLAY it is OK.

Query: Why it is happening locally on my monitor connected direct to my server? for root user it is OK.

Need forumers advise.

Thanks/cliff
4 REPLIES 4
Matti_Kurkela
Honored Contributor

Re: x display on Linux AS 4.0

There are several possible reasons.



To make X display connection work, these things must be true:

1.) the DISPLAY variable must be set (you know that...)

2.) the X display must allow connection (Reflection may allow any connection by default, but most Linux distributions require the correct authentication).

When you log on to Linux graphically, the authentication information is stored in ".Xauthority" file, which is normally in your home directory. If you use another username or move to another host, you must either disable the authentication (NOT RECOMMENDED) or carry the authentication data to the other host/user account.

You can extract the authentication data to a file like this: (on a computer+user which HAS the display)
xauth extract auth_file "$DISPLAY"

Then you must move the auth_file to such a place that it is readable to the computer+user which NEEDS the display, set the DISPLAY variable, and do this:
xauth merge auth_file

3.) The X display system must allow TCP connections. Reflection and "old" Unix servers allow this by default, but most new Linux distributions have this disabled.

This is set when starting the X display system. If you're using XDM as your login dialog, check the file /etc/X11/xdm/Xserver.
Usually there is only one line without the comment sign ("#"). If there is a "-nolisten tcp" option on that line, the display system will accept only local connections (in technical terms, only "Unix domain socket" connections).


If you use the SSH protocol and its built-in X display forwarding, all these three things are handled automatically:
1.) when connecting from a computer that has DISPLAY set, it automatically makes a correct DISPLAY setting for the destination computer. (It will look a little strange, but it works!)

2.) SSH handles X authentication keys automatically, you don't need to do anything for that

3.) Since the X connection is forwarded "inside" the SSH connection, the X display system sees it as a local connection.


By the way, this may sound strange but Reflection is actually an "X server", not an "X client". The applications which need something displayed to the user are X clients. The thing that actually puts the images to the screen is the X server.
This is very confusing, but the X protocol specification says so.
MK
Kodjo Agbenu
Honored Contributor

Re: x display on Linux AS 4.0

Hi Cliff,

Is /etc/hosts properly configured ?
Mine contains :

127.0.0.1 localhost loopback

Good lcuk.
Kodjo
Learn and explain...
Muthukumar_5
Honored Contributor

Re: x display on Linux AS 4.0

Why it is happening locally on my monitor connected direct to my server?

You have to have X client software to load the X windows in DISPLAY variable set machine.

--
Muthu
Easy to suggest when don't know about the problem!
Ivan Ferreira
Honored Contributor

Re: x display on Linux AS 4.0

He already found a solution:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=990011
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?