Operating System - Linux
1748035 Members
4991 Online
108757 Solutions
New Discussion юеВ

cannot open display on remote machine

 
SOLVED
Go to solution
iinfi1
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@192.168.5.223
root@192.168.5.223's password:
Last login: Sun May 17 02:27:41 2009 from 192.168.5.13
[root@localhost ~]# pwd
/root
[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=192.168.5.13:0.0
[root@localhost ~]# xhost +
xhost: unable to open display "192.168.5.13:0.0"
[root@localhost ~]# xclock &
[1] 3555
[root@localhost ~]# Error: Can't open display: 192.168.5.13:0.0

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


kindly let me know where i am going wrong.
if i do a ssh -X root@192.168.5.223
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
3 REPLIES 3
Matti_Kurkela
Honored Contributor
Solution

Re: cannot open display on remote machine

I think there are several problems in your attempt:

1.)
"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.

2.)
With this command sequence:

ssh root@192.168.5.223
export DISPLAY=:0.0

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

If 192.168.5.223 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 192.168.5.223.


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

[arvind@laptop ~]$ xhost +
[arvind@laptop ~]$ ssh root@192.168.5.223
[root@localhost ~]# export DISPLAY=192.168.5.13:0.0
[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...

3.)
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.

MK
MK
iinfi1
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
http://www.redhat.com/magazine/026dec06/features/tips_tricks/?intcmp=bcm_edmsept_007

thank you for your help again
avizen9
Esteemed Contributor

Re: cannot open display on remote machine

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

type hostname & password,

you should able to get display from remote machine,
thanks,