LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   remote X sessions (https://www.linuxquestions.org/questions/linux-newbie-8/remote-x-sessions-448492/)

binary_0011 05-25-2006 01:24 PM

remote X sessions
 
to locally display an X client application from a remote host, how do i do that?

Thanks.

pljvaldez 05-25-2006 01:29 PM

What OS is on the machine you're working from? If it's linux, you should be able to login with ssh and tunnel x over ssh. If the OS is Windows, you'll need to setup a VNC server on the linux box and then install TightVNC on windows.

jeelliso 05-25-2006 02:04 PM

If you're doing a Linux->Linux connection, I would recommend using PuTTY. All you have to do is enable X11 forwarding in your PuTTY settings and then you can run GUI commands just like normal.

In addition to what pljvaldez recommended for a Linux->Windows connection, you could install Cygwin and still use ssh.

~Justin

JimBass 05-25-2006 08:28 PM

The way I would accomplish that is to change the sshd config on the host being connected to, and allow x-forwarding, which (wisely) is turned off by default. Then when you are ssh'd into the server, just issue a command like konqueror, or firefox (no ampersand at the end), and it will appear on your local machine, but will be running off the remote one. This will allow you to connect to things on local IP networks to the remote server.

To ssh in with X forwarding, you need to issue the command on you local machine
Code:

ssh -X my.server.org
Doing this is of questionable value, as servers should not have GUI wasting their resources. Even though the X system doesn't run on the server the way it does on a desktop, you still eat system resources to simulate it. Furthermore, learing your way around a system through the command line interface (CLI) not only puts the proverbial hair on your chest, but gives you portable skills that aren't dependent on junk like the window dressing (ie someone saying, "I can do this in Gnome, but not in KDE"). When you can accomplish things from the command line, you can accomplish them anywhere, reagardless of the window dressing over the top.

Peace,
JimBass

binary_0011 05-26-2006 01:15 AM

does not work, here's my output :

Red Hat Enterprise Linux ES release 4 (Nahant Update 2)
Kernel 2.6.9-22.EL on an i686
login: andrew
Password:
Your default context is user_u:system_r:unconfined_t.

Do you want to choose a different one? [n]n
Last login: Fri May 26 14:14:13 from 202.108.124.189
[andrew@rhel4 ~]$ ssh -X 202.108.124.189
andrew@203.208.224.189's password:
Last login: Fri May 26 14:14:56 2006 from ccoc03.something.com
[andrew@rhel4 ~]$ xclock
Error: Can't open display:
[andrew@rhel4 ~]$




btw, i dont really understan this option :

xinit --:1
xinit --:0

how do i know when do i use wat number? how do i know wat number is the X server currently running?

Thanks.

spooon 05-26-2006 04:43 AM

Quote:

Originally Posted by binary_0011
does not work, here's my output :

Red Hat Enterprise Linux ES release 4 (Nahant Update 2)
Kernel 2.6.9-22.EL on an i686
login: andrew
Password:
Your default context is user_u:system_r:unconfined_t.

Do you want to choose a different one? [n]n
Last login: Fri May 26 14:14:13 from 202.108.124.189
[andrew@rhel4 ~]$ ssh -X 203.208.224.189
andrew@203.208.224.189's password:
Last login: Fri May 26 14:14:56 2006 from ccopnc08.singtel-expan.com
[andrew@rhel4 ~]$ xclock
Error: Can't open display:
[andrew@rhel4 ~]$




btw, i dont really understan this option :

xinit --:1
xinit --:0

how do i know when do i use wat number? how do i know wat number is the X server currently running?

Thanks.

some things:
* first, are you running X?
* make sure "X11Forwarding yes" is set in the /etc/ssh/sshd_config on the server
* try "-Y" instead of "-X"


All times are GMT -5. The time now is 07:42 PM.