X sessions thur SSH

Place to discuss Fedora and/or Red Hat
Post Reply
User avatar
cdhgold
administrator
administrator
Posts: 382
Joined: Tue Mar 18, 2003 6:11 pm
Location: Texas

X sessions thur SSH

Post by cdhgold » Thu Dec 14, 2006 12:00 am

I have been told that it is possible to have ssh forward X sessions .. I have to be able to access my X environment remotelly thru SSH .. how would i configure it so that when I ssh into my system i can use and see my X sessions (i'm running dual monitors w/ seperate desktops)

Chris

User avatar
Void Main
Site Admin
Site Admin
Posts: 5712
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Thu Dec 14, 2006 1:19 am

You *can* but you would get much better response times by configuring and using the VNC based remote desktop capabilities. If you use GNOME then click System->Preferences->Remote Desktop, or run the "vino-preferences" command. This is basically VNC integration which is much more efficient. Forward the VNC port rather than the X ports. I actually tunnel several ports between my machines at work and at home, both of which are behind firewalls and only expose ssh to a specific machine on a non-standard ssh port restricted to specific addresses.

This page gives the basics and might help:

http://www.cl.cam.ac.uk/research/dtg/at ... shvnc.html

Depending on how you have things set up you may need to use other options (I use "-R" instead of "-L" a lot). See the ssh man page which lists all the options and explain things pretty well.

Also, for the Remote Desktop to work you must already be logged on to the machine you want to remote control. Another option is to configure X to load the "vnc" module which will allow you to even remote control the logon (gdm). Another option is to use vncserver. This is handy to fire up a vnc controllable X session from a regular ssh login assuming you don't have vnc configured in X and without having remote desktop configured.

Of course ssh itself does X11 forwarding so you don't actually have to remote control the entire desktop. You can just ssh in to the remote box, run an X based application from the command line and it will display on your local X server. This can also be extremely slow though if you try to do this over a slow WAN/Internet connection.

User avatar
Basher52
guru
guru
Posts: 913
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Post by Basher52 » Thu Dec 14, 2006 1:38 am

I would personally go for FreeNX over VNC

go here and check it out:
http://en.wikipedia.org/wiki/NX_technology
http://www.nomachine.com/products.php

User avatar
cdhgold
administrator
administrator
Posts: 382
Joined: Tue Mar 18, 2003 6:11 pm
Location: Texas

Post by cdhgold » Thu Dec 14, 2006 7:50 am

allow me to elaborate further .. my work pc is of course on high speed lan link my home pc where i will be accessing it from is stuck on dial up which method do you think would perform best .. it goes like this home pc -> home lan -> dial up link to internet -> cisco vpn client -> work lan -> work pc. which method do you think would give me the best performance to be able to access my work fc6 pc and run my x app (java based).

Chris

User avatar
cdhgold
administrator
administrator
Posts: 382
Joined: Tue Mar 18, 2003 6:11 pm
Location: Texas

Post by cdhgold » Thu Dec 14, 2006 7:52 am

also i have dual monitors at work w/ seperate desktops and would like to be able to access both desktops from home where i also run dual monitors

User avatar
Basher52
guru
guru
Posts: 913
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Post by Basher52 » Thu Dec 14, 2006 8:18 am

I dont have much knowlegde about this, but a pal of mine has used both VNC and NX and I have at least seen both in use and i say that NX is way beter than VNC.
He showed me just some days ago, when he connected to his home server using NX/VNC over a 10mbit connection(as the weakest chain) and NX handled the mousemovements alot better than VNC.

But I think Void should have the final say, because I guess he's more into all this than me.
Last edited by Basher52 on Fri Dec 15, 2006 1:25 am, edited 1 time in total.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5712
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Thu Dec 14, 2006 9:13 am

I shouldn't have final say on anything. :) Use what works the best for you. Try both. I can say forwarding X natively would be *slow* and probably completely unusable over dialup. The only reason I suggested VNC is because it's actually now part of Xorg and integrated into GNOME. All you need to do is turn it on and use the VNC client. But since you are using dialup you will probably want to find the fastest that works for you.

The first thing you want to do is get the remote desktop (whatever form you choose) working on the local network. Then it's just a matter of forwarding/tunneling the associated port via ssh. Here is another thread regarding a couple of different VNC options:

http://voidmain.is-a-geek.net/forums/vi ... php?t=1809

I actually do not do a lot of remote control. Nearly everything I need to do can be done via an ssh/bash prompt. It's extremely rare that I have to have access to some remote graphical app across a slow network.

Post Reply