Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting x application to display remotely

Status
Not open for further replies.

jdubowy

Programmer
Mar 1, 2001
13
0
0
US
I have been trying (and failing) to get x applications running on a remote network to display on my laptop at home. I am running Red Hat 9 on my sony Vaio pcg-fx215, sharing the internet with other computers via a router and DSL. I know that some of my coworkers are succeeding in getting the applications to display at their homes (also using DSL and routers), and so it should be possible for me too.

When I log in (via ssh), the DISPLAY variable is automatically set to my home domain. From the remote network, I've pinged the domain name to make sure it is valid, and it succeeds. One thing I a unsure of, however, is whether or not this domain name truly identifies my computer (as opposed to identifying my router). How can I determine how my particular computer is identified by the outside world (given that my router is using NAT, and that my comptuer is identified by the router by an internal IP 192.168.2.xxx)?

I've tried using xauth (extracting my cookie and merging it with the newtork's list) as well as xhost (allowing connection from my work network's IP). Still, I get error messages saying that the x client is unable to connect to my display.

If anybody has an idea of what might be wrong, I'd greatly appreciate hearing from you. let me know what other information you need from me in order to diagnose the problem.

Thanks,
jdubowy
 

Modern linux distro are built for the desktop which means they're not listening on the network for incoming X connections. In the file that starts the X server (/etc/X11/xdm/Xservers) you have to edit the last line and remove notcp (or similar).

Cheers

Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
Thanks for the reply.

I looked in /etc/X11/xdm/Xservers, and the only thing written is the following line:

:0 local /usr/X11R6/bin/X

Should I add anything in order to make the server listen for incoming X conections? Also, I am wondering if I need to configure my router to listen for particular incoming TCP/IP (whichever port is used for making X-connections).

By the way, I just managed to get a remote x app to display locally by the following method:
ssh -l [username] [remote IP] [x-app]
I am still unable to invoke x-apps separately after login, however, and can not invoke them in the background. (I guess this is just a minor inconvenience, but I'd still like to figure out what's wrong.)

thanks again,
jdubowy
 
Hold up, if you're logging in remotely using ssh with X forwarding, everything should work fine. You do not need to know how to identify your computer remotely because your X connections are going through your ssh tunnel anyways. X connections going through an ssh tunnel will appear to be locally initiated to your firewall software.

Is ssh setup to forward X connections by default? if not, you'll need a "-X" in your ssh command line (that's capital X). so it should be something like:

ssh -X -l user remoteserver

let me know if that helps.

-Venkman
 
I was under the impression that, even if not using X-forwarding, I'd still use ssh in order to login and invoke the X applications. How do I determine whether or not X-forwarding is being used (as opposed to the x-client making a direct connection to my x server via some X connection protocol)?

Assuming I do use X-forwarding, should I be able to login in first, and then invoke x applications (even in the background)? Or is the way I am doing it now
('ssh -X -l user remoteserver remoteapp', all at once, using a separate local Xterminal for each remote X app invoked)
the only way to do it?

-jdubowy
 
If you use the "-X" flag, X forwarding will be enabled (regardless of whether it was enabled or disabled by default). Logging in using that flag, you will be able to run x programs from the command line that will then be displayed on your home machine.

You can use X remotely without ssh, but don't. It will leave you system insecure. Plus, it's more difficult to setup (requires editing configuration on your computer, making sure firewalls are open for ports, and setting up port forwarding).

-Venkman
 
Thanks for the help and information.

-jdubowy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top