I have 2 machines one is RHEL and other is CENTOS 5.what i did is i want to run xclock application of RHEL5 from CENTOS 5 box.X11 forwarding is enabled on RHEL5.firewall is turned off on both machines.
so i need to set DISPLAY variable,i did it like thisCode:[root@centos5 ~]# ssh root@RHEL5 passwd ******* [root@RHEL5 ~]# echo $DISPLAY [root@RHEL5 ~]# xhost CENTOS 5 IP address (aa.bb.cc.dd) [I dont know why i got this error] xhost: unable to open display ""
CENTOS 5 IP address (aa.bb.cc.dd) being added to access control listCode:[root@RHEL5 ~]# DISPLAY=:0.0 [root@RHEL5 ~]# export DISPLAY [root@RHEL5 ~]# echo $DISPLAY :0.0 [root@RHEL5 ~]# xhost CENTOS 5 IP address (aa.bb.cc.dd)
[root@RHEL5 ~]#exit
I came out from RHEL5 box and now i am in CENTOS 5 box
[root@centos5 ~]# xclock -display RHEL 5 IP (xx.yy.xx.zz):0.0
Error: Can't open display: RHEL 5 IP (xx.yy.xx.zz):0.0
again i logged into RHEL 5 box echoed for display variable it was empty,again i tried like this
[root@RHEL5 ~]# DISPLAY=RHEL 5 IP (xx.yy.xx.zz):0.0
[root@RHEL5 ~]# export DISPLAY
[root@RHEL5 ~]# echo $DISPLAY
RHEL 5 IP (xx.yy.xx.zz):0.0
i came back to centos machine ,again i got the same error
[root@centos5 ~]# xclock -display RHEL 5 IP (xx.yy.xx.zz):0.0
Error: Can't open display: RHEL 5 IP (xx.yy.xx.zz):0.0
from this i came to conclusion that DISPLAY variable is not preserved between logins,so i need to set DISPLAY variable permenently.my question is what i am thinking is right or wrong?after this i edited RHEL 5 root user .bashrc file
i added these lines in .bashrc file in roots home directory
DISPLAY=RHEL 5 IP (xx.yy.xx.zz):0.0
export DISPLAY
now between logins display variable is set
[root@RHEL5 ~]# echo $DISPLAY
DISPLAY=RHEL 5 IP (xx.yy.xx.zz):0.0
now i went to CENTOS 5 box
[root@centos5 ~]# xclock -display RHEL 5 IP (xx.yy.xx.zz):0.0
Error: Can't open display: RHEL 5 IP (xx.yy.xx.zz):0.0
again i got the same error.
please any one help me on this issue.any help is greatly appreciated.


LinkBack URL
About LinkBacks




Reply With Quote