Technical article 108895

Get the error "Xlib: Connection to "hostname:0.0" refused by server"

OpenServer 5.0.0OpenServer 5.0.6

Written · Last revised

Problem

I try to run clients remotely but I receive errors:

Xlib: connection to "hostname:0.0" refused by server Xlib: Client is not authorized to connect to Server Error: Can't Open display

Cause

The host that you are trying to display the clients on does not grant the control access to the host that runs the client.

Solution

Run xhost(X) to grant access to remote hosts.

For example, your local host is "podgy".  You telnet to remote host
"fusion" and want to run some clients from "fusion" and display them
on "podgy".
1. Log in to podgy.
2. Start the X environment at podgy.  For example, enter the command
   startx from the command line, or log in from xdm.
3. Grant control access to fusion:
# xhost +fusion
3. Telnet to fusion.
4. Set the PATH environment variable.
For Bourne shell:
# PATH=$PATH:/usr/lib/X11
# export PATH
For C shell:
% set path=($path /usr/bin/X11)

5. Run the clients from fusion and display them on podgy.

# xeyes -display podgy:0 &
NOTES:
- Intead of specifying the "-display" option for each client
  program you invoke, you may want to instead set the DISPLAY
  environment variable.  Then any X client invoked will use
  that display.
For Bourne/Korn shells:
# DISPLAY="podgy:0"
# export DISPLAY
For C shell:
% setenv DISPLAY="podgy:0"

Then, to invoke the xeyes client for an example:

# xeyes &
- Intead of running the xhost command manually every time
  the X server is started, you can pre-specify which clients
  can be displayed to your X server.  For example, for your
  primary X server, you could include the line "+fusion" in
  the /etc/X0.hosts file on the podgy machine.  Please see the
  man page on xhost(X) for further details.

See also

1. xhost(X). 2. The article "How do I run multiple X servers and local or remote X clients?" from the same database.

From the Xinuos technical article database, record 108895. Reproduced with permission. The original is at www.sco.com/ta/108895, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.