summary xhost

From: Ramanna Chetan (Chetan.Ramanna@nmg.sms.siemens.com)
Date: Mon Sep 21 1998 - 15:37:24 CDT


Thanks to everyone who replied

The problem was solved, by runnin xhost on the machine itself, like on
its console.
I was telneting to that machine and tryin to run xhost.

Thanks again guys.

Orig Question.

I have a SunOS NIS master server runnin 4.1.4
I have about 40 NIS clients runnin SunOS 4.1.3 & SunOS 4.1.3_U1
When I do /usr/openwin/bin/xhost + on the server or any NIS clients I
get The followin error message.

xhost: unable to open display ""

I want to run xhost + on some of the machines to disable the access
control, so that I can run an X-Emulation program like Exceed on PC's to
run apps of the clients and server machines.

How do I fix the problem.
Please let me know of the steps involved in settin up the xhost command
on these machines.
Thanks Will summarize

Replies were

> When I do /usr/openwin/bin/xhost + on the server or any NIS clients I
> get The followin error message.
>
> xhost: unable to open display ""

Did you set the DISPLAY variable, eg:

   %setenv DISPLAY <hostname:0>

xhost has to know which X server on which host you mean...

Rgds,

-H-

Harvey M Wamboldt ^ E-Mail: harvey@iotek.ns.ca
MDA Inc 1000 Windmill Rd. Suite 60 ^ Fax: (902)468-2278
Dartmouth NS, B3B 1L7, Canada ^ Phone: (902)481-3531

------------------------------------

Set the DISPLAY environment variable first, either as an
address or a hosname (if it can be resolved to an address).
If your IP address is 10.1.1.1 then do one of the following
(the :0.0 on the end tells it to use the first framebuffer on
the first display, a :0 usually works as well. also the address
can be replaced with whatever 'hostanme' returns, or on some
machines just setting the display to ':0' will work).

csh:

setenv DISPLAY 10.1.1.1:0.0

ksh,bash, etc:

export DISPLAY=10.1.1.1:0.0

If you then get a 'permission denied' error, it means the current
display is owned by another user, try it from a console window.

On Mon, 21 Sep 1998, Ramanna Chetan wrote:

>
> hello gurus,
>
> I have a SunOS NIS master server runnin 4.1.4
> I have about 40 NIS clients runnin SunOS 4.1.3 & SunOS 4.1.3_U1
> When I do /usr/openwin/bin/xhost + on the server or any NIS clients I
> get The followin error message.
>
> xhost: unable to open display ""
>
> I want to run xhost + on some of the machines to disable the access
> control, so that I can run an X-Emulation program like Exceed on PC's
to
> run apps of the clients and server machines.
>
> How do I fix the problem.
> Please let me know of the steps involved in settin up the xhost
command
> on these machines.
> Thanks Will summarize
>
>
> Chetan Ramanna
> Siemens Medical Systems
> Off (847) 304 7383
> E-Mail chetan@sgsn01.nmg.sms.siemens.com
>
>

--
Frank Smith                              Voice: (512) 343-2002 x449
Systems Administrator                    Fax: (512)343-1717
TradeOne Marketing.                      Email: franks@tradeonemktg.com
11149 Research Blvd. Ste. 400            Web: www.tradeonemktg.com
Austin TX 78759-5227                       

--------------------------------------

> Hi Harvey, > > for eg i have an NIS client machine host1 > On host1 i do the followin > > setenv DISPLAY host1:0 > > I get the followin error message after i run xhost + > > xhost + > xhost: unable to open display "host1:0" > > what is the problem?

Well you have to run "xhost +" on host1 (as the user who is running the X server). The easiest way to do this is to run xhost locally on host1. You can verify that there is a path to the X server by running a command that talks to the server, such as "xhost" or "xrdb -query".

Also, xhost has to be able to resolve the name "host1" into an IP number. That means your "hosts" database in the NIS has to be accessible from where you run the xhost program. You can verify that the NIS is accessible by running the command "ypmatch host1 hosts" (or maybe it should be `host', I forget, we run DNS now to resolve hostnames into IP addresses.

Does any of this help?

-H-

---------------------------------------------

Have you set the display environment on the clients?

ex. with csh - setenv DISPLAY (host or IP):0.0

Kelly ---------------------------------------------

The xhost command is used so that others allowed to display X-apps on your console. Doing an xhost + allows everybody who has a network connection to your machine to display X-apps on your console. Some OS' you need to be on the console in order to enter in this command.

Lets say you want server A to display an X-app from server B, you need to type in the following:

On server A: xhost serverB

On server B: DISPLAY=serverA:0.0 export DISPLAY /opt/xxx/xxx/bin/xapp & (As an example) Now xapp will display on Server A's console.

With exceed when you log in you only need to set the DISPLAY variable to PCHOST:0.0, I think this can be done with a -d @ option. [Refer to exceed manual as it has been a long time] then run the app and is should show up on your PC's console. No need to actually run anything on the server.

Hope this helps, Marco Greene cmgreene@netcom.ca

-------------------------------------------------------

You need to set DISPLAY environment variable first. So if machine on which X server runs is foo.bar.com, than you want to do something like:

DISPLAY=foo.bar.com:0 export DISPLAY

before calling xhost.

BUT!!!

"xhost +" is big security risk. It may be better idea to run xdm (X Display Manager) on your server, and than connect X Servers on clients to it using XDMCP. Aleksander --------------------------------------------------

Set DISPLAY environment variable somewhere and then you can run xhost pacefully: #setenv DISPLAY machine:0 #xhost +

Adrian ------------------------------------------------------

you must set your DISPLAY variable or possibly use the -display option to xhost. try this:

in ksh:

export DISPLAY=host:0

Derek ------------------------------------------------------

set ur DISPLAY environment variable

Esaie Vermilus

------------------------------------------------

If you are running Exceed you do not need to enable xhost access on the Sun Machines since you are not trying to display to their console. I.E. in xstart to open an xterm you would use rlogin or rsh and send xterm -sb -display name.or.IP.of.PC:0.0 & this will put an xterm on your PC desktop (since they already have access enabled...) Aaron ---------------------------------- The xhost + command needs to be run on the host where you want the window to appear and not on the machine it is running on. Also try it with the IP address instead of the hostname, since sometimes the X server is resolving names differently (i.e. DNS, NIS, NIS+, /etc/hosts) than what you might think. If you are using DNS, I once ran across a problem where the Xserver was doing reverse lookups as well - check if a nslookup on 'host1 returns the address you expect, and also nslookup on that address and see if returns the exact same thing ( ie host1 and not host1.domain.com), if it returns host1.domain.com try setting your DISPLAY to host1.domain.com:0.0 and see if that helps. Can you open a remote window from any machine, or is it a problem from/to just one?

Frank ----------------------------------------------------------

You shouldn't need to run "xhost" on the Unix boxes, if you plan to display Unix apps on the PC's.

* Launch Exceed on the PC using an xdm query, pointing to your Unix box * Login to the Unix box * set DISPLAY back to the PC:0 (syntax depends on shell) * Launch Unix app in the xterm window * View app on the PC

You would only need to run xhost on the Unix box to paint it's display from the PC.

Earl R Cooke Kistler UNIX Support Phone 310.332.3325 Pager 310.718.0208 ----------------------------------------------------------------------

Unless you are at the console, you have to export your display as an environment variable to tell the xhost which X server you want to alter xhost permissions on. So basically just

If running csh:

setenv DISPLAY <ip address of server>:0.0 xhost +

if running ksh

export DISPLAY=<ip address of server>:0.0 xhost +

Let me know if you need additional assistance. :)

Mike Evans Professional Computer Geek ---------------------------------------------------------------

It looks like the $DISPLAY environment variable is not defined. Try defining it first:

setenv DISPLAY host:0.0

Just to be complete, it is not a good idea to use the '+' argument with xhost, as this opens up the system's X server to everyone. It is much more secure to use a list of hostnames to which to grant access.

Dave --------------------------------------------------------

Only the person with control of the display can run xhost. So if you are login remotely to a machine, you don't run xhost on that machine.

Let's say you have: A--------->B

You are logged in to A with an X Server. Then you telnet to B. You want to run an application on B and display it on A. To do this, you'd set the display on B to be A. Then on A, you'd run xhost to allow B to display at A.

A: B: xhost + setenv DISPLAY A:0.0 (using C shell) >command to run your app. app shows up here

Dixon -----------------------------------------------------

be sure that you run the xhost command on the client, before you login to the remote server and set your display to the client. it sounds as if you are either not executing the command on the correct machine, or that you execute it in the wrong order.

hope this helps.

cathy ------------------------------------------ Chetan Ramanna Siemens Medical Systems Off (847) 304 7383 E-Mail chetan@sgsn01.nmg.sms.siemens.com



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:12:49 CDT