tags:

views:

331

answers:

2

This may seem like a strange question but it has some value for the project I am currently working on.

I have a Windows 2003 server running XMing (or Cygwinx). I am connecting to the server from Ubunutu using ssh with X11 forwarding enabled. When I launch any X application on the Windows 2003 server (such as xeyes) the application displays on the Windows server and not on the local Ubuntu machine.

Xming is a fully implemented X Server so I assumed it would support serving X applications to remote clients. Any suggestions why this is not working?

A: 

What is happening is the correct behaviour. The X Server (XMing) is running on Windows 2003 and serving the Xeyes application (a client) to you.

From Wikipedia with some edits ...

The X server accepts requests for graphical output (your W2003 server's display) and sends back user input (from your keyboard, mouse, or touchscreen).

X Window System's client-server terminology — the user's terminal being the server and the applications being the clients — often confuses new users, because the terms appear reversed. But X takes the perspective of the application, rather than that of the end-user: X provides display and I/O services to applications, so it is a server; applications use these services, thus they are clients.

fpmurphy
I don't agree that this is the correct behaviour. Xeyes is being launched from the Ubuntu ssh session (connected to the Windows 2003 server) so it should display on the Ubuntu desktop not on the Windows desktop. If I reverse this situation (connect from the Windows server to the Ubuntu box) I get the correct behaviour, that is, Xeyes is launched in a Windows ssh session and displays in Windows.
Richard Dorman
+1  A: 

Sounds like the ssh server is not acknowledging the X forwarding request. After you login, check the environment and you should see the DISPLAY variable set, indicating host and display (e.g. localhost:10); if that is missing, the X clients will use the default (e.g localhost:0) DISPLAY.

Also, the X server on the remote machine (the one ssh'd into) has no bearing on this, only the X clients installed there. When you ssh to the remote machine, your local Ubuntu host is the X server, accepting connections from the remote X clients.

libjack
When I first connect via SSH my display variable is not set. I have manually set it to DISPLAY=127.0.0.1:0.0. This still results in the x application displaying on the remote desktop.
Richard Dorman
There are configuration options for sshd for enabling/configuring X11 Forwarding. On my linux server, for example, the file /etc/ssh/sshd_config contains "X11Forwarding yes"; not sure where this config would be for the Windows server
libjack
Finally managed to work this one out. The problem was with the access control setting. The simple solution (although not a secure one) is to turn off access control on the X Server. So 'xming -ac -multiwindow' to start the X server on the client machine, then 'ssh -X userAip' to the host machine and finally 'export DISPLAY=clientip:0.0' once the connection is made.
Richard Dorman
Looks like there is one more configuration setting that may be necessary for running remote X apps. Run gdmsetup on the Ubuntu box and uncheck 'Deny TCP connections to Xserver'. By default this is checked.
Richard Dorman
Ah, that's a big one, that would always get in the way... thanks for finding that.
libjack