System Administration
Showing results for 
Search instead for 
Did you mean: 

cannot open display on remote machine

Go to solution
Super Advisor

cannot open display on remote machine

i am not able to open display on a remote machine.
this is what i have been trying

[arvind@laptop ~]$ ssh root@
root@'s password:
Last login: Sun May 17 02:27:41 2009 from
[root@localhost ~]# pwd
[root@localhost ~]# export DISPLAY=:0.0
[root@localhost ~]# xhost +
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

xhost: unable to open display ":0.0"
[root@localhost ~]# export DISPLAY=
[root@localhost ~]# xhost +
xhost: unable to open display ""
[root@localhost ~]# xclock &
[1] 3555
[root@localhost ~]# Error: Can't open display:

[1]+ Exit 1 xclock
[root@localhost ~]#

kindly let me know where i am going wrong.
if i do a ssh -X root@
things work fine. but not this way.

i mainly want this to work because i am trying to install Oracle on virtuozzo containers (similar to solaris containers) where in i am not able to get the display going either on a remote machine. ssh -X is not working on containers.

please help
Honored Contributor

Re: cannot open display on remote machine

I think there are several problems in your attempt:

"xhost +" tells the X server (on your laptop) to disable X11 protocol security. The problem is, it uses the X11 protocol to do that. You can use "xhost +" only if X11 protocol access is already allowed. In other words, if you want to use "xhost +", enter the command on your laptop _before_ ssh'ing to the remote host.

Or enter the "xhost +" command in another local terminal window on your laptop: it is not connection-specific, but takes effect on your entire X11 session.

With this command sequence:

ssh root@
export DISPLAY=:0.0

... you are asking the X applications to connect to the display of the machine, not to the display of your laptop.

If is a rack-mounted server, it may not even *have* a graphical display installed. The error message 'Xlib: connection to ":0.0" refused by server' indicates there is no local X server running on

So, assuming that is the IP address of your laptop, the correct command sequence would be:

[arvind@laptop ~]$ xhost +
[arvind@laptop ~]$ ssh root@
[root@localhost ~]# export DISPLAY=
[root@localhost ~]# xclock &

The first command tells your laptop to accept unauthenticated remote X11 connections, the second is a standard ssh command, and the third tells the X applications on the remote host to send their windows to the display of your laptop.

But it still might fail, because...

Most Linux distributions will disallow all unencrypted remote X11 connections by default. This is done by adding "-nolisten tcp" to the startup options of the X server. You would have to find out how the X server is started on your laptop and remove this option, then restart your X display manager (logging out and back in will not be sufficient).

If your laptop has an iptables firewall configured, you would also have to allow incoming access to TCP port 6000.

My suggestion:

If ssh -X is not working on virtuozzo containers, you should find out why and fix it. The most common reason is that /etc/ssh/sshd_config in the remote machine/container has X11Forwarding disabled by default. Change it to "X11Forwarding yes", restart sshd and try connecting again.

Using "ssh -X" is not only more secure, it is often actually *easier* than the old-style procedure.

Super Advisor

Re: cannot open display on remote machine

thank you..
i did the X11Forwarding to yes
and also i had to install a package xorg-x11-xauth

i got an error
debug1: Remote: No xauth program; cannot forward with spoofing.
and found the workaround here

thank you for your help again
Esteemed Contributor

Re: cannot open display on remote machine

do you have reflection X manager installed?
Select > Linux
Methord > Open SSH

type hostname & password,

you should able to get display from remote machine,