Page 1 of 1

#1 Help! Problem with export display.

Posted: Mon Oct 09, 2006 6:00 am
by Kreshna Aryaguna Nurzaman
Well, I'm using a PC X Server to display Linux X applications (Linux GUI like Oracle Universal Installer, xclock, etc) on my Winblows desktop. I'm using the good old WinAxe Plus 7.3, which I've been using for few years.

The Linux I'm running is RHEL 4 ES on VMWare 5.5.1, connecting with PuTTY 0.58. Naturally, the first step I did to ensure the Linux GUI could run on my Windows desktop is exporting the display to my host:

Code: Select all

export DISPLAY=192.168.21.195:0.0


Yup, that was my IP in the local network.

And then, the next step is executing xclock to test whether the GUI could appear on my Windows desktop.

Code: Select all

xclock &


And of course, the first time I ran those commands, they were executed flawlessly. Just like usual.

However, lately, I often experienced the problem below:

Code: Select all

[oracle@linux ~]$ export DISPLAY=192.168.21.195:0.0
[oracle@linux ~]$ xclock &
[1] 3096
[oracle@linux ~]$ Xlib: client uses different protocol version (11) than server (0)!
Error: Can't open display: 192.168.21.195:0.0

[1]+  Exit 1                  xclock
Yes, client uses different protocol version (11) than server (0)!. Now what the hell was that supposed to mean? Note that the problem is intermittent; sometimes it just happens, sometimes it doesn't. I couldn't figure what the fuck is the cause, but sometimes, restarting the Linux AND the PC X Server solves the problem.

Such thing actually never happened to me before. Ever. And yes, I have been using WinAxe as PC X Server since 2004, and I've been using it on Red Hat, HP UX, etc without experiencing such problem. However, it is the first time indeed I'm running Red Hat on VMWare.

What's wrong? Is it the PC X Server, the Linux itself, or the VMWare? Help!

#2

Posted: Mon Oct 09, 2006 8:50 am
by Destructionator XV
What I would do is simply update putty and the PC X server. It looks like you are using old versions anyway.

The error message is bizarre; X11 has been in use for over 10 years now (almost 20!), so it is pretty absurd the server doesn't use it. It is probably a bug in the PC X server. Updating to the newest version will probably take care of that.



One other thing: if you are using putty for SSH, you shouldn't be using the DISPLAY variable method, because it is an insecure method of doing it. Since you are on a LAN, it is no big deal, but here are the steps anyway.

Instead, turn on X11 forwarding on both the client and the server. In /etc/ssh/sshd_config, there should be a line that says

Code: Select all

X11Forwarding no
Change it to

Code: Select all

X11Forwarding yes
If it already says yes, then it is turned on and you have nothing to worry about.

Next, in putty, in the options page that comes up when you start the program, look under Connection, and there will be a SSH. Expand that, and there is X11. Click it, and on the right there is a checkbox to Enable X11 forwarding. Turn it on, and you can use X applications over the SSH link directly, without needing to export display.

This has the added advantage of encrypting the X traffic, and you can use SSH compression if you want (no good for LANs, but pretty great over the Internet).

Once the X11 forwarding is turned on on both sides, you can skip the export step. Simply use xclock or whatever as soon as you log in.


If you are not using SSH, you should be, even on a LAN. Telnet and rlogin are both very obsolete and insecure.

#3

Posted: Mon Oct 09, 2006 8:22 pm
by Kreshna Aryaguna Nurzaman
Destructionator XV wrote:One other thing: if you are using putty for SSH, you shouldn't be using the DISPLAY variable method, because it is an insecure method of doing it. Since you are on a LAN, it is no big deal, but here are the steps anyway.

Instead, turn on X11 forwarding on both the client and the server. In /etc/ssh/sshd_config, there should be a line that says

Code: Select all

X11Forwarding no
Change it to

Code: Select all

X11Forwarding yes
If it already says yes, then it is turned on and you have nothing to worry about.

Next, in putty, in the options page that comes up when you start the program, look under Connection, and there will be a SSH. Expand that, and there is X11. Click it, and on the right there is a checkbox to Enable X11 forwarding. Turn it on, and you can use X applications over the SSH link directly, without needing to export display.
Well I have done the step above (using X11 Forwarding instead of Export Display), and it actually worked.

However, when I re -started WinAxe (the PC X Server I'm using) while still connected to Putty

Code: Select all

[root@linux cdrom]# xclock &
[2] 2955
[1]   Terminated              xclock  (wd: ~)
(wd now: /src/ora10201/cdrom)
[root@linux cdrom]# Xlib: client uses different protocol version (11) than server (0)!
Error: Can't open display: localhost:10.0

[2]+  Exit 1                  xclock
Well, when using export DISPLAY method, usually restarting WinAxe while the PuTTY is disconnected fixed the problem. This time, I tried to do the same again, and this is what I got:

Code: Select all

[root@linux ~]# xclock &
[1] 3029
[root@linux ~]# X connection to localhost:10.0 broken (explicit kill or server shutdown).

[1]+  Exit 1                  xclock
[root@linux ~]#
:thewall:

#4

Posted: Mon Oct 09, 2006 8:31 pm
by Destructionator XV
What happens when you start up the X server, then start up putty and try to use the ssh X11 forwarding only?

I always have X running before even opening putty with my boxen and never have any problem like this (though I use Xming on Windows instead of WinAxe).

#5

Posted: Mon Oct 09, 2006 8:39 pm
by Kreshna Aryaguna Nurzaman
Destructionator XV wrote:What happens when you start up the X server, then start up putty and try to use the ssh X11 forwarding only?
Well, sometimes it fixes the problem, but sometimes I get this error message:

Code: Select all

[root@linux ~]# xclock & 
[1] 3029 
[root@linux ~]# X connection to localhost:10.0 broken (explicit kill or server shutdown). 

[1]+  Exit 1                  xclock 
[root@linux ~]#
See, the problem is intermittent; sometimes it happens, sometimes it doesn't, and in neither cases you know what the cause is. :sad:


Destructionator XV wrote:I always have X running before even opening putty with my boxen and never have any problem like this (though I use Xming on Windows instead of WinAxe).
Xming? Is that a better PC X Server product? Is it less resource-intensive than WinAxe? Where to get it?

Alternatively, how to install/configure a VNC Server on Linux? I'm thinking of using NX Client anyway.

#6

Posted: Mon Oct 09, 2006 8:47 pm
by Destructionator XV
Kreshna Aryaguna Nurzaman wrote:See, the problem is intermittent; sometimes it happens, sometimes it doesn't, and in neither cases you know what the cause is.
That is weird. It must be caused by a race condition or something. Will be a bitch to fix, even if you can figure out what is going on.


Xming? Is that a better PC X Server product? Is it less resource-intensive than WinAxe?
I don't really know. I was just googling for a Free Software X server for Windows and it is the one I found that actually installed and ran. I never had a chance to try any others.
Where to get it?
Direct download link to the setup program
Alternatively, how to install/configure a VNC Server on Linux?
Here is one I have installed:
http://www.tightvnc.com/download.html

And here is a direct link to one of the install help pages: http://www.tightvnc.com/doc/unix/README.txt

I have never actually used it except for testing though, so I can't say too much more about it.

#7

Posted: Mon Oct 09, 2006 9:34 pm
by Kreshna Aryaguna Nurzaman
Thanks! I'm gonna' trie both Xming and VNC. Heck, probably VNC is better anyway. The reason I'm using PC X Server is actually just in case where the Linux / UNIX I'm connecting to doesn't have VNC Server ready.