LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Access X remotely (https://www.linuxquestions.org/questions/linux-software-2/access-x-remotely-426409/)

depam 03-19-2006 07:40 PM

Access X remotely
 
Hi! I do have RH9 and Fedora running. Now my question is that how can i access the x server of rh9 remotely. I run fedora on init 3 (which is the multi-user mode). I ssh RH9 and did the following commands:

export DISPLAY=192.168.0.221:0 (192.168.0.221 is my fedora's IP)
xhost +

and then I did xinit in fedora but each time i type in startx the display only appears on rh9's unit and not on my fedora. What did I do wrong?

marcheikens 03-19-2006 10:32 PM

What kind of access are you looking for? If you're just trying to run a windowed app on the server and have the window show up on the remote client, just use X-forwarding.

NOTE: username@REMOTE indicates the machine you're trying to use to connect to your SERVER, denoted by username@HOST. May have been able to figure out better names but I'm tired :)

Code:

username@REMOTE$ ssh -l username host.address -X
Then run the program you want from the terminal that's logged into the host:

Code:

username@HOST: $ firefox-bin
That will run firefox on the SERVER but display the window on the machine you are logging in from.

If you're looking to access the entire desktop and the windows that are open on your screen at home, I'd try using x11vnc (I don't use RedHat any more, but you might be able to apt-get it if you've got that set up). Then you'd just have to do the following:

Code:

username@REMOTE: $ ssh -l username host.address -L 5900:localhost:5900
username@HOST:$ x11vncviewer -display :0

Then on the remote client, run a VNC viewer (xvncviewer, or one at http://www.realvnc.com or Chicken of the VNC for Mac OS X), and connect to 127.0.0.1:0.

Now if you're willing to have a new instance of your desktop (can't interact with windows that are already existing on your "usual" desktop but this can be nice because you can use blackbox or some other lighter window manager), instead of tunneling port 5900, tunnel port 5901:

Code:

username@REMOTE: $ssh -l username host.address -L 5901:localhost:5901
username@HOST:$ vncserver -geometry heightxwidth :1

Then use one of those fancy VNC viewers and connect to localhost:1. You'll have to dig for informationon configuring VNC to use different window managers. I set it up the way I like it, and I've since forgotten precisely how I've configured it. I'd make sure that you do this through ssh, simply because then passwords and such aren't sent in the clear if you use it to do any work on your machine.

That's what I do anyway. Took me a couple weeks to get all of it working the way I wanted it to, but now I have a fairly good understanding of VNC. Hope I was clear enough. Keep in mind NONE of these is a wonderful solution--either colors are a bit messed up or the responsiveness is lacking, but it's always better than nothing.

marc

And I just stumbled on this thread while trying to figure out why I can't log into my machine via ssh with a new username I created!

depam 03-19-2006 11:04 PM

There is a way to access remote X without using VNC. Where in you can export the display to a specific IP. I know VNC but can it be done without this service?

spooon 03-20-2006 12:46 AM

Quote:

Originally Posted by depam
There is a way to access remote X without using VNC. Where in you can export the display to a specific IP. I know VNC but can it be done without this service?

Did you read about SSH's X forwarding above? That is a much better way to do the same thing.

jkilla11 03-29-2006 09:48 PM

hi ya, i'm a noobie but i tryed what someone said on # 2 and it did not work here is the output info

justin@Pegasus:~$ ssh -l jb82 192.168.1.111 -X
jb82@192.168.1.111's password:
Last login: Sun Jan 10 04:27:21 1999 from 192.168.1.100
Linux 2.4.26.

May all your PUSHes be POPped.

jb82@jb82:~$ kopete
kopete: ERROR: KUniqueApplication: Can't determine DISPLAY. Aborting.
jb82@jb82:~$

spooon 03-29-2006 09:54 PM

Quote:

Originally Posted by jkilla11
hi ya, i'm a noobie but i tryed what someone said on # 2 and it did not work here is the output info

justin@Pegasus:~$ ssh -l jb82 192.168.1.111 -X
jb82@192.168.1.111's password:
Last login: Sun Jan 10 04:27:21 1999 from 192.168.1.100
Linux 2.4.26.

May all your PUSHes be POPped.

jb82@jb82:~$ kopete
kopete: ERROR: KUniqueApplication: Can't determine DISPLAY. Aborting.
jb82@jb82:~$

First, try "-Y" instead of "-X".
Code:

ssh -Y jb82@192.168.1.111
Also, if you have root on the computer you are connecting to, check /etc/ssh/sshd_config on it and make sure "X11Forwarding" is set to "yes".

marcheikens 03-30-2006 12:59 AM

Shouldn't that be:

Code:

ssh -Y -l jb82 192.168.1.111
?

Do you have another instance of the program already running on your computer? Some times when I have evolution running on a VNC display and forget to shut it off, and then try to start it on the standard display, it ends up just opening a new window on the VNC desktop, not on the desktop I want. I think--not exactly sure, but I think--that I've received display errors when trying to run another instance of some programs already running. Just a thought.

marc

jkilla11 03-30-2006 02:19 AM

hi again all,
i did exactley what you said to do i uncomments out the fordwarding thing and changed it to yes, then i tryed to login with the -Y frist dident work and then tryed the -X one dident work something about cant figure out the display do i need to setup a pusdo monitor?


jb82@jb82:~$ kopete
kopete: ERROR: KUniqueApplication: Can't determine DISPLAY. Aborting.
jb82@jb82:~$ xmms

** CRITICAL **: Unable to open display

spooon 03-30-2006 04:11 AM

Oh yeah, did you restart the SSH daemon after you changed the config?

jkilla11 03-30-2006 11:27 AM

i restarted the whole system, i am not to good at restarting services ix stop sshd start sshd


NOTE- sorry fellas forgot to mention it still dosent work haveing something about screen errors...dont understand why.

marcheikens 03-30-2006 11:50 AM

spooon--I've never used -Y on the ssh command line. What's the difference between X forwarding and "trusted" X forwarding? I can't find much of a discussion about it anywhere...

marc

spooon 03-30-2006 03:15 PM

Quote:

Originally Posted by marcheikens
spooon--I've never used -Y on the ssh command line. What's the difference between X forwarding and "trusted" X forwarding? I can't find much of a discussion about it anywhere...

marc

http://www.openssh.org/faq.html#3.13


All times are GMT -5. The time now is 05:51 AM.