Cannot display xclock program on xserver client - Mobaxterm

sotn picture sotn · Sep 3, 2013 · Viewed 36.9k times · Source

I am using Mobaxterm(free version) on a windows 7 desktop to connect to a SUSE 11 Enterprise server on AWS. I am trying to display the xclock program on my xtrem client but I get an error saying 'Error: Can't open display:'. I have used the following syntax to set the display on the server:

export DISPLAY=<IP_addr>:0.0

SUSE 11 does not come with xclock by default so I had to download it and install it. The hosts file on my PC has the localhost entry commented out, I am not sure if that would make a difference. Any ideas on how to debug this? Thanks.

Answer

sotn picture sotn · Sep 4, 2013

Fixed!

Earlier I was just looking at xclock program's error msg. But when I scanned Mobaxterms client terminal's output, I found the following msg:

X11 forwarding request failed on channel 0

After some google hunting, found that one of the reasons this happens is when xauth package is not installed on the remote server. So, I checked and found that to be the case. This is the command I ran:

zypper in -name xorg*

This command tells you if the package is installed and if any dependencies exist. The package comes bundled with the xclock program. So zypper uninstalled the other xclock I had installed from another source and replaced it with the right version.

Link to package info: https://www.suse.com/LinuxPackages/packageRouter.jsp?product=server&version=11&service_pack=&architecture=i386&package_name=xorg-x11-xauth

I also modified a file called /etc/ssh/sshd_config as root. The following lines need to be uncommented:

X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

And X11UseLocalhost was changed to 'no'. I also changed my security group on AWS to let inbound traffic on port 6000. I am not sure if that matters.

After this mobaxterm automatically set my display parameter to localhost and I was able to run xclock on the remote server and see it on my local PC desktop.