Operating System - HP-UX
1819500 Members
3291 Online
109603 Solutions
New Discussion юеВ

xhost + error: unable to open display

 
SOLVED
Go to solution
Jagadesh_2
Regular Advisor

xhost + error: unable to open display

Hi,

When i issue the command "xhost +" in HPUX telnet session as root, i am getting the following error

error:
-----------
root # xhost +
xhost: unable to open display ""
------------

Please let me know how to rectify this.

thanks
S.Jagadesh
13 REPLIES 13
Matthew_50
Valued Contributor
Solution

Re: xhost + error: unable to open display

possibility is that you are trying to run "xhost" before actually getting into X on your local machine.

machine$ # Get into X windows.
localmachine$ xterm &
localmachine-xterm$ echo $DISPLAY

if none of above, then do following to setup the DISPLAY variable.
localmachine-xterm$ export DISPLAY="localmachine:0.0"

localmachine-xterm$ xhost +remotehost
"remotehost" added to access list.

localmachine-xterm$ telnet remotehost
## Log into remote host

remotehost$ export DISPLAY="localmachine:0.0"
remotehost$ xterm
Jagadesh_2
Regular Advisor

Re: xhost + error: unable to open display

Thanks for the response.
My putty terminal is set to xterm only
#echo $TERM
xterm

I am opening this putty session from windows. I also have cygwin application installed. After issuing startx from the cygwin application i will get a X icon at the bottom of the task window.
----------------------
$ startx
DISPLAY is :2
Updating PuTTY profiles...
sh: reg: command not found

Your PuTTY profiles have now been updated to use the current X session.

The X server appears as an 'X' icon in the Windows system tray on your taskbar.

(If you use the command-line SSH client, enter 'export DISPLAY=localhost:2'
before doing so.
---------------------

In putty terminal i enabled the X11 fowarding too.

After making all these settings when i run xhost + iam getting an error "unable to open the display. Even i tried to set the DISPLAY variable
export DISPLAY=hostname of windows:0.0
still i am facing the problem. Let me know how to rectify the same.

thanks
Matthew_50
Valued Contributor

Re: xhost + error: unable to open display

well, you need the application such as Reflection or X-win32 or Xmanager to run the x-terminal or x application on your desktop pc.
Matthew_50
Valued Contributor

Re: xhost + error: unable to open display

also, I believe that 'startx' is linux command :-)
Bill Hassell
Honored Contributor

Re: xhost + error: unable to open display

The xhost command fails because you have not set the DISPLAY value. Xwindows is a very special environment and it starts with the DISPLAY value being set to the IP address of your display device. This is known as a "display server" and is probably your PC. You set the value in this manner:

who -muR

The last entry on the line is the IP (or hostname) of your PC, so you set the DISPLAY value to this IP address plus :0 to specify which screen to use. You can do this in one command like this:

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

However, Xwindows does not exist in PC windows, you must buy a Xwindow emulator such as WRQ's Reflection/X or Hummingbird's Exceed or similar.

On the other hand, there is no reason whatsoever to run Xwindows (like xterm, dtterm, hpterm) for a character mode interface. If you're not drawing pictures or stuck with an application that requires Xwindows, don't use it. Putty, QCterm, even WRQ's Reflection for HP (a terminal emulator) are 100x more efficient than Xwindows.


Bill Hassell, sysadmin
morganelan
Trusted Contributor

Re: xhost + error: unable to open display

Hi Jagadesh,

xhost + can only running on XWindows mode so use Telnet application that support XWindows such as ReflectionX from WRQ inc.After install that telnet software you can run xhost + without any difficulties.
Kamal Mirdad
vinod_25
Valued Contributor

Re: xhost + error: unable to open display

hi jagdeesh

Add the hostname of the computer to the /etc/hosts file.

The system will then be able to properly set the DISPLAY variable.

Cheers !!!

Vinod
Martin Brachtl
Advisor

Re: xhost + error: unable to open display

Hi.

I guess, you would like to do something else.
Start xhost + on your local machine, and than telnet to the remote host and start remote X client application.

Am I wrong?

MBr.
Patrick Ware_1
Super Advisor

Re: xhost + error: unable to open display

Ok, here is my issue. I am running into the same issue when on my local HP-UX workstation. I log into the offending server (which is also HP-UX), and issue the xhost + command. I get the same error (unable to open display ""). The thing is, I am not the only user getting the errors. Multiple users are getting the same error. Anyone know what is going on?
Raj D.
Honored Contributor

Re: xhost + error: unable to open display

Hi Jagadesh ,
You have to establish a tunnel with your putty session with your server.

Are u using any xwindow client..like VNC.
Are you looking to run xapplications.

Cheers.
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Raj D.
Honored Contributor

Re: xhost + error: unable to open display

Also check your display variable set correctly.

From your current server do

$ export DISPLAY=xhostserver:0.0

any luck ,

Raj.
--


" If u think u can , If u think u cannot , - You are always Right . "
Alan Meyer_4
Respected Contributor

Re: xhost + error: unable to open display

on the application machine, you can do a who -am to see who you are connecting from.
" I may not be certified, but I am certifiable... "
Allan Ruiz
New Member

Re: xhost + error: unable to open display

Hello Everyone,

I trying to run a vncserver, but when I try to run xhost +, I get the same error.

unable to opendisplay, I just try everything. I just wondering if there's something else beyond the DISPLAY variable, like the XF86 configuration?

Best Regards,

ACR