- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- can't set DISPLAY with hostname
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2007 11:40 AM
тАО06-06-2007 11:40 AM
I can't bring up xclock if I set the DISPLAy with hostname.
i,e:
export DISPLAY=`hostname`:0.0
I can bring up xclock if I set to IP Address
i,e:
export DISPLAY=XXX.XXX.X.X:0.0
Any idea?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2007 12:07 PM
тАО06-06-2007 12:07 PM
Re: can't set DISPLAY with hostname
can you nslookup "hostname" ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2007 01:03 PM
тАО06-06-2007 01:03 PM
Re: can't set DISPLAY with hostname
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2007 02:23 PM
тАО06-06-2007 02:23 PM
Solutionhosts: files [NOTFOUND=continue] dns
If you don't have /etc/nsswitch.conf, create one with:
cp /etc/nsswitch.files /etc/nsswitch.conf
chmod 644 /etc/nsswitch.conf
then edit the new file as mentioned.
The sole purpose of /etc/hosts and DNS is to associate an IP address and one or more names together. Eliminate all the DNS politics by specifying /etc/hosts first in the nsswitch.conf file.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2007 03:33 PM
тАО06-06-2007 03:33 PM
Re: can't set DISPLAY with hostname
adedd16p:root [/etc] cat nsswitch.conf
#
# /etc/nsswitch.files:
#
# @(#)B.11.11_LR
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# does not use any name services.
#
passwd: files
group: files
hosts: files [NOTFOUND=continue] dns
services: files
networks: files
protocols: files
rpc: files
publickey: files
netgroup: files
automount: files
aliases: files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2007 09:45 AM
тАО06-07-2007 09:45 AM
Re: can't set DISPLAY with hostname
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2007 09:57 AM
тАО06-07-2007 09:57 AM
Re: can't set DISPLAY with hostname
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2007 12:12 PM
тАО06-07-2007 12:12 PM
Re: can't set DISPLAY with hostname
The issue is not fixed.
---------------------------------------------
$ export DISPLAY=`hostname`:0.0
$
$ xclock &
[1] 11821
$ Error: Can't open display: dev1:0.0
[1] + Done(1) xclock &
----------------------------------------------
I followed the steps suggetsed by Bill Hassel, yet I not able to bring up the GUI.
This is quite important since a lot of our scripts use hostname in DISPLAY & they would be broken due to this small issue.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2007 12:35 PM
тАО06-07-2007 12:35 PM
Re: can't set DISPLAY with hostname
> $ export DISPLAY=`hostname`:0.0
$ Error: Can't open display: dev1:0.0
Well, let's start by asking where your display device is located. The above works just fine on a local workstation with a graphics card, mouse and keyboard. When you run the hostname command on the HP-UX computer, it will return it's hostname, in this case, dev1. My guess is that you are not using the workstation's display but instead you are using a Linux box or a PC running an Xwindow emulator. And the purpose of the DISPLAY variable is to tell Xwindows where to send the graphics images. In other words, DISPLAY must be set to your display device's IP address.
So while the construct: export DISPLAY=`hostname`:0.0 will work just fine on the local workstation, re-displaying the image on some other computer requires a totally different construct like this:
export DISPLAY=$(who -muR | awk '{print $NF}');0.0
Run the command: who -muR and you'll see that it reports your local computer's IP address or hostname, which is what you want. When you set DISPLAY=someIPaddress, it works because you did not set it to the HP-UX box address, you set it to the PC or Linux box address. The who -muR command will provide that detail for you automatically. The scripts that have `hostname` coded will all have to change or the users must always run the script sitting in from of the HP-UX workstation.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2007 12:37 PM
тАО06-07-2007 12:37 PM
Re: can't set DISPLAY with hostname
> $ export DISPLAY=`hostname`:0.0
$ Error: Can't open display: dev1:0.0
Well, let's start by asking where your display device is located. The above works just fine on a local workstation with a graphics card, mouse and keyboard. When you run the hostname command on the HP-UX computer, it will return it's hostname, in this case, dev1. My guess is that you are not using the workstation's display but instead you are using a Linux box or a PC running an Xwindow emulator. And the purpose of the DISPLAY variable is to tell Xwindows where to send the graphics images. In other words, DISPLAY must be set to your display device's IP address.
So while the construct: export DISPLAY=`hostname`:0.0 will work just fine on the local workstation, re-displaying the image on some other computer requires a totally different construct like this:
export DISPLAY=$(who -muR | awk '{print $NF}'):0.0
Run the command: who -muR and you'll see that it reports your local computer's IP address or hostname, which is what you want. When you set DISPLAY=someIPaddress, it works because you did not set it to the HP-UX box address, you set it to the PC or Linux box address. The who -muR command will provide that detail for you automatically. The scripts that have `hostname` coded will all have to change or the users must always run the script sitting in from of the HP-UX workstation.
Bill Hassell, sysadmin