1753301 Members
6918 Online
108792 Solutions
New Discussion юеВ

$DISPLAY not getting set

 
Amod
Occasional Advisor

$DISPLAY not getting set

I have recently installed RedHat 8 on my PC. But when I run the 'Terminal' program my DISPLAY doesn't get set to <0.0>.

I get following
[root@gardner] # echo $DISPLAY
:0.0

What's going wrong ?
If you can't change it, enjoy it !!
4 REPLIES 4
Eugen Cocalea_1
Occasional Advisor

Re: $DISPLAY not getting set

Is hostname set? What does 'hostname' command report?
It's not a shame to be born stupid. It's a shame to die being stupid.
Steven E. Protter
Exalted Contributor

Re: $DISPLAY not getting set

If hostname is correctly set, you can set the display in .bash_profile (not sure I spelled that right) or /etc/profile. If its a pc, it will work.

In reality you don't need a hostname set to use red hat in graphical mode. You can set display by IP address.

DISPLAY=10.1.10.77:0.0
export DISPLAY

make sure the IP address is up on a network device like eth0

P
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
John Meissner
Esteemed Contributor

Re: $DISPLAY not getting set

you can also use your hostname to set your display

DISPLAY=hostname:0.0

or if you're telnetting into another server you can set your display by running this script:

var1=$(who -mT | sed -e 's/.*[ ]\([^ ]*\)$/\1/')
export DISPLAY=$var1:0.0

All paths lead to destiny
Rick Beldin
HPE Pro

Re: $DISPLAY not getting set

XOpenDisplay() recognizes :0.0 as referencing the local display (console). The hostname is not needed in the local display mode, and XOpenDisplay() can actually (and sometimes does) enable different transport mechanisms depending on how the DISPLAY is set up.

A local display could mean that it would use a more efficient transport, such as shared memory, as opposed to using TCP sockets, which have to go through name resolution and what not.

You also may find that under Linux some of the utilities do not enable TCP sockets for security reasons. For example, xfs (fontserver) doesn't enable socket connections from outside the box in the default mode.
Necessary questions: Why? What? How? When?