Xwindows on dynamic IP?
January 4, 2007 10:00 AM   Subscribe

X Windows filter: I have a Windows XP desktop with a static IP address. I connect to a unix machine and run certain programs that have graphical user interfaces, which in turn appear on my desktop monitor. I want to do the same with my laptop on a dynamic IP address, obtained automatically. HELP!

To be able to do this task on my desktop machine, I start an X Windows emulator, XWin32 in this case. Then login to the unix machine using a secure shell client. Finally, in the secure shell client, I issue the following command:

setenv DISPLAY ###.###.###.###:0.0

(###.###.###.### is my static IP address)

How can I accomplish this on my laptop, which obtains a dynamic IP address (presumably a different one) everytime I start a new internet connection?

I don't know a whole a lot about networking. But, if there is a way of figuring out the IP address for a particular connection session, then my problem is solved? If so, how can I find that IP address?
posted by eebs to Computers & Internet (6 answers total)
 
Maybe I'm missing something, but why wouldn't you want to tunnel your X session over SSH as well.

When you use ssh, append -Y to your commandline, and it should work without the setenv DISPLAY line.

ie.
ssh -Y username@unixserver.com

Note that the server admin has to allow X forwarding (X11Forwarding yes in the sshd_config file) If they're ok with you forwarding X sessions in the clear, I'm sure they'd be willing to enable that for you.
posted by Nodecam at 10:11 AM on January 4, 2007


Note that in general setting DISPLAY in the way that you are doing means that all X windows traffic goes over the network in the clear. That includes everything you type at the keyboard.

As others have said, use ssh to tunnel the X connection over the securely encrypted ssh connection. In my experience, it's also worth compressing the ssh connection as it makes a significant difference.
posted by pharm at 10:56 AM on January 4, 2007


If the laptop is also a Windows machine, you might try using PuTTY. It supports X11 forwarding (in Connection -> SSH -> X11), and once configured properly, should work for both your laptop and desktop machines.
posted by lalas at 12:55 PM on January 4, 2007


The advice above is sound, and you should follow it. But for future reference in case you have the same need for some other reason: you can use a free dynamic DNS provider (like dyndns.com or no-ip.com) to get a fixed DNS address that will map to your dynamically assigned IP address. Any decent broadband router will have an option to auto-update such a service on connection, or you can install a small client on your PC to do the same thing for dialup connections.
posted by flabdablet at 6:18 PM on January 4, 2007


And to answer your original question: if your laptop's running XP, open a cmd window (Start->Run, type cmd into the Run: box and hit Enter) and enter the following command:

ipconfig /all

This will show you, among many other things, the current IP address your dialup connection is using.

For Windows 98: Start->Run, type winipcfg into the Run: box, and when the winipcfg window appears, click More Info.

If the IP address shown for a particular connection is in one of the non-routable ranges (typically 192.168.x.x or 10.x.x.x) then that connection is most likely shielded from the Internet by a NAT router, and you'll have to do a bit of fooling about with that to make it possible for your PC to accept incoming connections from outside.
posted by flabdablet at 6:28 PM on January 4, 2007


Response by poster: Late follow up (due to technical problems) :

Thanks for all the good info. After I read all of your comments, I went back to the software and looked for words "X11" and "tunneling" (I told you I wasn't network savvy, hence the unfamiliarity with the terminology) and sure enough there was a check box with the text "X11 Tunneling". I checked the box and voilĂ , my problem solved; no more "setenv" stuff.

Thanks.
posted by eebs at 11:17 AM on January 7, 2007


« Older How to find a good mother's helper or other...   |   How accurate is this infrared thermometer? Newer »
This thread is closed to new comments.