View Full Version : Setting up remote programs to natively use X11
I'm new to this XWindows/X11 thing, and I was trying to get a program to run via Apple's X11 implementation.
The problem is that every time I start up the program, it says it is unable to initialize X-Windows, and so it assumes terminal mode. However, I lose many features of the program (namely drawing some graphs) without the X-Windows system. Note that I have to SSH into a remote server to be able to access the program.
Can someone help me on how to get this program to recognize the X11 system so I can access all the features of the program? Any suggestions would be very appreciated.
simX,
1- Are you connecting to the remote server from inside an XTerm or from within Terminal? In the latter case, you first have to do:
setenv DISPLAY :0
(for bash it's "export DISPLAY=:0")
2- After connecting to the remote server from an XTerm, check:
echo $DISPLAY
(to see if it's set correctly in the remote server)
3- You can get more detail of what ssh is and isn't doing by adding "vvv" to the flags; so it might help running:
ssh -vvX remotehost /path/to/remoteapp
4- What's the Resolution in the remote server?
Many problems are due to configuration issues. The most likely causes are:
a) "X11Forwarding yes" is not set in the /etc/sshd_config file of the machine you are ssh'ing to.
b) you have *not* set the DISPLAY environment variable to :0 or didn't start X11.app on the local machine before you ssh'd to the remote host.
c) you *do* set the DISPLAY environment variable in a login script on the remote server, so it overrides the one ssh has set.
d) maybe you are trying to run a very old X program and are using sshd 3.1 or higher on the remote server. In that case, you have to add "X11UseLocalhost no" to the sshd_config on the remote machine. Note that adding this option is potentially more insecure (though there are no known exploits afaik) that the default setting of "yes".
sao: Thanks for the response. I was actually trying both ways: first from within Apple's X11.app (running an xterm process), and then using the Terminal.
The server I am connecting to is a VMS server, so "echo $DISPLAY" doesn't work. I would assume this is part of the problem, but I wouldn't know how to fix it. All I know is that when my co-workers connect to the server when they are on-site, it uses the X-Windows system correctly -- however, they are using Windows machines, not Mac OS X.
I also don't have access to the remote server, so I couldn't really change any variables around on the server. But I assume they're set up correctly since people who log in on-site are able to use the program correctly via X-Windows.
Any other information you can give me? (One other question, if you can answer it: how do you get a delete to act like a normal backspace in XTerm, rather than having simply put the cursor at the beginning of the line?)
simX wrote:
how do you get a delete to act like a normal backspace in XTerm
Check the "Apple's X11 FAQs" at the top:
15 - Delete Key
Um, I looked in Apple's FAQ, but I don't see that question... maybe I'm looking in the wrong place, but is this ( http://developer.apple.com/qa/qa2001/qa1232.html ) not the correct place?
Oh, by the way, that page DID address my other question: I only need to add a "-X" option to use X-Window forwarding.
hayne
02-27-2003, 12:08 AM
I have no personal experience with running X11 programs on VMS and displaying them remotely but a quick google search for: X DISPLAY variable VMS
gave a few possibly useful pages:
E.g.:
http://www.physics.umn.edu/support/vms/x.html
shows how to check the value of the DISPLAY variable in VMS
simX wrote:
Um, I looked in Apple's FAQ, but I don't see that question.
Sorry, I was not clear enough it seems. I meant the "X11: Frequently Asked Questions" here, at the top of the Unix-Apple's X11 forum:
Number 15- Delete key
simX wrote:
I only need to add a "-X" option to use X-Window forwarding
Of course you need to, I thought you already knew that. :)
Like I said, I am a total X11 newbie. Thanks a lot for your help, though. :)
ziyad
03-17-2003, 08:56 PM
What should the ip be if u have a home network. My network ip is 192.168.0.100 and my router ip is 192.168.0.1
Which IP should I use.
bluehz
03-18-2003, 12:13 AM
ziyad - are you trying to connect to a machine inside your network (LAN)? Or are you trying to connect from outside your network - say at work, back to your home?
Depending on which you are doing - the answer is different. If you are connecting from one machine to another within your own network - then use the actual IP 192.168.0.xxx of the other machine.
If you are trying to connect from outside your network - you will need to determine the actual IP assigned to your connection at the router point. Remember that those 192.168.0.xxx addresses are for non-internet use only. So any attempts to use that over the internet to access your home box will end up failing. Your router on the other hand has an IP assigned to it either permanently or everytime you connect, depending on whether you are dialup, DSL, Cable, etc. You need to determine this IP number and that is what you would use to access your network from outside. You can usually pull up a config screen on your router by entering its address 192.168.0.1 into a web browser. Usually somewhere in there it will tell you what your actual IP (often called WAN) is. After determining that you will also need to forward specific X11 ports to the machine you want to access from outside the network. I believe it is port 6000 that you must open to forward X11 stuff. Note that having an open port to an X11 machine can pose a security risk. Just so you know.
ziyad
03-18-2003, 02:26 AM
Thanks for the suggestions .
Let me give u a bit more detail.
I'm at home and tring to connect to a Solaris server at school.
I have a pc and a mac.
Using reflection X (and using SSH) on a pc I don't have to worry about any thing, I just say connect to this server and it does and I'm able to run my unix applications without any problem.
But with mac I need to say setenv DISPLAY ip:0.0
Now the problem is which ip to use. I don't know how reflection X on pc works. I haven't opened any ports or done anything.
So I have tried 192.168.0.100 and my router address that is 192.168.0.1 but nothing works. I even used visual route on mac and got the ip address that my router connects to which start from 68.******.
But no luck.
One way I found was to remove my router and connect my cable modem directly to my mac and then connect, and then put the router back on. the mac seems to be slow to recognize it and i'm able to log in and use my applications without even using the setenv command.
Let me check the wam address u mentioned in your reply.
bluehz
03-18-2003, 07:20 AM
Not familiar with Reflect. What is it?
Sounds like your router is the problem here. In general most routers are NAT Routers which means that when you send a request out for a connection to another machine, it responds back and the router assigns basically a random port to that connection and then hooks up that random port to your internal machine. NAT = Network Address Translation. In most cases this system works fine. This is the reason that most NAT Routers make for fairly descent firewalls in themselves. In some cases though NAT can break the chain of events that connect to endpoint.
I would recommend opening port 6000 on your router, then locate the Forwarding section of your router Setup (prob via web browser 192.168.0.1) and forward port 6000 to the machine you are trying to connect from. If running a firewall on your local machine -make sure it is open for port 6000.
I assume you have all privileges required to access the remote machine - correct?
Then try in the terminal:
ssh -X username@remote_machine_address
EX:
ssh -x tom@my.solaris.net
or
ssh -s tom@235.356.261.142
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.