Cygwin/X problems ... help meh please

evildre

[H]F Junkie
Joined
Oct 23, 2000
Messages
13,345
Okay ... I can start X in Cygwin by typing "startx" at the prompt. Then, I do the following:

DISPLAY=localhost:0.0
export DISPLAY
ssh -X -l my_login_name remote_machine_name

I can ssh in to the remote machine just fine. After I enter the password, I am greeted with the following message:

Warning: No xauth data; using fake authentication data for X11 forwarding.
...and then the rest of the welcome message. When I enter the command "xterm &" in the ssh prompt, it prints the PID of xterm, but then gives me this message:

xterm Xt error: Can't open display: my_machine's_IP:0.0

[1] Exit 1 xterm

The machine I am ssh-ing into is a Solaris 5.8 box. I don't have too many ports open on the machine I am ssh-ing in from, though ... just 20, 21, 22, 23, 25, 53, 80, 3389, 5500, 6667, and 7100. What am I doing wrong? What can I do to fix the error that I am getting so I can run X apps on the Win2K box I am using?
 
Don't set $DISPLAY yourself. SSH will handle all that for you with -X. You also shouldn't forward all those ports. The only thing forwarded on my firewall is the port Freenet uses. Again, SSH tunnels everything through itself.

That being said, it may be an idiosyncrasy with the Cygwin version of SSH, as I've been playing with my machines and keep getting disconnects when using Cygwin/SSH to talk to an old HPUX machine at my undergrad university. PuTTY is working fine, though, as is SSH and X11 through FreeBSD. Go figure.

Lastly, you may wish to feed SSH a -v to get debugging output. If you hit a snag it will tell you what and where.
 
Originally posted by Snugglebear
Don't set $DISPLAY yourself. SSH will handle all that for you with -X. You also shouldn't forward all those ports. The only thing forwarded on my firewall is the port Freenet uses. Again, SSH tunnels everything through itself.

That being said, it may be an idiosyncrasy with the Cygwin version of SSH, as I've been playing with my machines and keep getting disconnects when using Cygwin/SSH to talk to an old HPUX machine at my undergrad university. PuTTY is working fine, though, as is SSH and X11 through FreeBSD. Go figure.

Lastly, you may wish to feed SSH a -v to get debugging output. If you hit a snag it will tell you what and where.

I think I'll need to try another SSH client, because it just flat-out doesn't work. So ... how do I go about doing that? :D
 
Originally posted by evildre
The machine I am ssh-ing into is a Solaris 5.8 box. I don't have too many ports open on the machine I am ssh-ing in from, though ... just 20, 21, 22, 23, 25, 53, 80, 3389, 5500, 6667, and 7100. What am I doing wrong? What can I do to fix the error that I am getting so I can run X apps on the Win2K box I am using?

You need to have ports 6000 and 6010 open so the remote X11 apps can connect to your X11 server.
 
You don't need either of those skritch. I know it sounds wrong, but with Cygwin/ssh, it works. The return connection from the foreign X11 box comes back over the established SSH tunnel, and Cygwin seems more than happy to accept connections from machines not listed in xhost.

EDIT: For alternate SSH clients, I'd suggest PuTTY. They make X11 real complicated.

putty.jpg



EDIT: I've been digging into this a bit on a couple different platforms. The newer versions of SSH are avoiding xhost auths altogether; with -X they use a local proxy X11 server to forward remote connections to which then goes and makes the connection to the real local X11 server. Doing so prevents magic cookie leakage. The -X will also have SSH set $DISPLAY and Xauthority on the remote server as it has for years. The last time I did massive X11 forwarding through X11 was 9 months ago and the local proxy thing certainly didn't work right back then.

Anyway, the -X is all you need. No setting xhost locally, no setting $DISPLAY remotely. SSH does it all and does it correctly. As for Cygwin, it may have some odd bugs in it. No matter what I do the connections to remote hosts get killed when using the internal SSH. Using PuTTY allows SSH to connect and forward to Cygwin X11 properly. Cygwin/SSH is the same version and config as what's on all my FreeBSD machines, and they work, so go figure.
 
Originally posted by Snugglebear
You don't need either of those skritch. I know it sounds wrong, but with Cygwin/ssh, it works. The return connection from the foreign X11 box comes back over the established SSH tunnel, and Cygwin seems more than happy to accept connections from machines not listed in xhost.

Hm. On second thought, you're right; the ports are forwarded back through the SSH connection. I'm not sure what I was thinking about there.
 
You just get used to doing it the old way. It doesn't help that in the past -X didn't always work too well with SSH.
 
Originally posted by Snugglebear
You don't need either of those skritch. I know it sounds wrong, but with Cygwin/ssh, it works. The return connection from the foreign X11 box comes back over the established SSH tunnel, and Cygwin seems more than happy to accept connections from machines not listed in xhost.

EDIT: For alternate SSH clients, I'd suggest PuTTY. They make X11 real complicated.

putty.jpg



EDIT: I've been digging into this a bit on a couple different platforms. The newer versions of SSH are avoiding xhost auths altogether; with -X they use a local proxy X11 server to forward remote connections to which then goes and makes the connection to the real local X11 server. Doing so prevents magic cookie leakage. The -X will also have SSH set $DISPLAY and Xauthority on the remote server as it has for years. The last time I did massive X11 forwarding through X11 was 9 months ago and the local proxy thing certainly didn't work right back then.

Anyway, the -X is all you need. No setting xhost locally, no setting $DISPLAY remotely. SSH does it all and does it correctly. As for Cygwin, it may have some odd bugs in it. No matter what I do the connections to remote hosts get killed when using the internal SSH. Using PuTTY allows SSH to connect and forward to Cygwin X11 properly. Cygwin/SSH is the same version and config as what's on all my FreeBSD machines, and they work, so go figure.

Hmm ... so what you're saying is I have to use PuTTY's SSH client to establish an SSH connection (with X11 forwarding turned on) and then I can use Cygwin to start X programs and such? I'll have to give it a shot ... I've been using PuTTY for a while now, but I never really paid any attention to X options since I never had to use it before :D
 
You *may* need to use PuTTY. My Win2k/Cygwin box absolutely could not establish SSH connections to several remote machines. Why, I have not a clue. Since I always have PuTTY installed and it always connects, I tried forwarding with PuTTY when I had Cygwin/X11 up. Worked fine. If nothing else seems to fix your problem, give it a shot. It's only a 5 minute expenditure if it doesn't work.
 
Nope ... nothing. I still have another 2 weeks until the project I need to work on is due ... I guess I'll have to go and buy the software from the school's store so I can work on it at home.
 
Back
Top