Running remote X Win apps on OS X

Fusengammu

Registered
I have OS X running in my apt, and I want to run an X app from school, so I start OroborOSX on my machine and type

xhost <remote machine name>

on my terminal, and xhost adds the remote machine to the access control list.

Then I set the DISPLAY variable on the remote machine to the my <IP address:0.0> which I get from Network Utility. When I try to run something like "xterm" on the remote machine, it never ends up being shown.

I suspect this is because I am on a cable modem AND a router, because my roommate and I are sharing the connection. I remember way back when running through a SLIP connection and being able to display remote X Win apps(very very slowly) on my Linux box at home, and would love to be able to do this again. Anyone know how?? :confused:
 
if you are behind a NAT firewall router (which you almost certainly are, if you are sharing a home connection), then you need to get your router to forward port 6000 to your machine. in general, if you want to use any type of server from behind a NAT firewall, you will need to get the router to forward the port that the server uses. X uses 6000
 
>> if you are behind a NAT firewall router (which you almost certainly are, if you are sharing a home connection), then you need to get your router to forward port 6000 to your machine.


Okay, I looked through the docs for my router, and it does say that it is a NAT firewall router. But I couldn't find anything about how to forward port 6000 to my machine. Do I do that through OS X's Network Control Panel? The "Proxies" tab says something about SOCKS firewall and also something about a port. Also, I read through the documents and it says my IP address should be set to 192.168.xxx.xxx, which means that if I type this in as my DISPLAY variable on the remote machine, it probably means nothing, because there are thousands of people with the same IP address I have since that is what the router hands out... Do you what <IP address>:0.0 I should be giving as my DISPLAY??

thanx
 
what kind of router do you have? if it is one of those generic home routers from linksys or netgear, then you access its config through a webbrowser.

so first, figure out what its IP address is. maybe it will be 192.168.0.1, or something. that will be in the documentation, along with a login. so type that IP in your browser, and login. then, somewhere in the configuration, it will give you an option to specify a port, and then specify what host to forward it to. here you will put 6000 for the port, and your local machines IP for the host to forward to. you can find your local machines IP by typing ifconfig en0 at the command line. (there are probably a number of ways to find your local IP, and it seems like you have one already?)

save the config, and login. it may require you to restart the router, it may not.

now, login to the remote host, and set the display to myIP:0.0

myIP that i specify here is not your machines local IP, but your network IP on the Internet. that is how traffic on the internet finds you. it is the IP that your router presents to the internet, it masks your local ip and translates it to this global IP. your routers config might be able to tell you what this IP or hostname is, but at this point the easiest way is to type this on the command line of the remote host (which has the x client that you want to use)

either type:
$ who am i
or
$ echo $REMOTEHOST

i have found that the first one will tell you your Internet IP (actually fully qualified domainname, but it doesn t matter which you use) in parentheses after your name. this one works on solaris or linux.

some systems don t give that information in respone to who am i. then i can get it from echo $REMOTEHOST, only if i am using the enhanced tenex c shell (tcsh). bash does not set this environment variable. i ll wager there is a way to find the info from bash too. anyone can tell me what this is?

ok so this should work if you can find all these infos. let us know

BTW, i am also physicist in training. way to go us!
 
Ahh, so that's what the screen shot of the web browser in the doc was. I forgot what brand my router is. But thanks for the tips. Now I think I know what to do.

Cool! OS X is great for physics BTW. In fact the reason why I wanted the X DISPLAY was so I can make sure my hmwk for my "math for physicists" class displayed correctly in postscript on the SUN servers at school so that I could print it and turn it in. Too bad we're doing stat right now:( Its my least favorite area of math because its BORING. Oh well, can't complain.

The fact that OS X has all the programming tools AND great media support just kicks ass. 5, 6 years ago I couldn't imagine being able to use perl, C, gnuplot and stuff + use something as cool as iTunes to listen to internet radio while I work, play MacMAME and RockNES (mmm 80s video games) when I'm bored.

thanx for the tips. i'll try them out when i get home
 
Back
Top