• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

how do I redirect X windows to a different machine through SSH?

Special K

Diamond Member
I am logged into a linux machine via cygwin/SSH on Windows XP. The problem is that when I try to run commands that would open windows on the remote machine if I were actually logged into it, such as nedit or emacs, nothing happens on my end. How can I make these windows appear on my screen? I tried this command:

setenv DISPLAY <my_ip_address>:0.0

But that didn't do anything. Is there a command I can run that will cause all of the windows on the remote machine to open on my machine?
 
Did you use -X or -Y when connecting via ssh? Also setenv is a csh command, if you're using another shell you need to use that shell's command to set up environment variables, but ssh should do that for you if X forwarding works.
 
You need to be running an X server on your XP machine. At work we use reflectionsX but its insanely overpriced... but there are plenty of OSS options on sourceforge.
 
OK, I have the following in my local .cshrc:

if (`ps -ef | grep /usr/X11R6/bin/XWin | grep -v grep | wc -l` == 0) then

XWin -multiwindow -ac -clipboard >& /dev/null &
endif

The X server seems to be starting, because any X windows I open on my local machine are appearing. However, when I use ssh -x, none of the windows on the remote machine are appearing.

What am I doing wrong?
 
I can't remember for sure if ssh's X forwarding requires that the X server be listening on a TCP port, but I believe not listening is the default these days.
 
OK, I figured it out now. I was using "ssh -x" (without the quotes). I should have used "ssh -X". Apparently the -x/-X flag is case-sensitive. Using -x actually disables X forwarding.

Now it works as expected, although the windows don't seem to be as responsive as when I am logged in through VNC.
 
Most things in unix are case sensitive. The X protocol isn't very light-weight so it won't be as responsive as if you're using a good remote desktop program, but if the bottleneck is the network you might get better performance by using blowfish encryption and compression in SSH.
 
Back
Top