Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
ok i have 2 computers running red hat 7.3. Each has X installed. when i ssh into one computer from another, is there any way to use a GUI while working through ssh? kind of like pcanywhere or windows remote desktop? if so can you please explain how to do this. I know whenever I enter any X commands in ssh it tells me that X is already running on display 0. can anyone help me out?
I normally use it by forwarding the vncserver listening port on the server to the client via ssh, then connect to the clients local port with vncviewer. This encrypts the connection.
3. run this command in the xterm
xhost +remotemachine
4. run this command in the xterm
ssh -X remotemachine
That's it, just run any X app you want on the remote machine by typing the command in the xterm
Also if you start X on the local machine without a window manager you could also run a window manager from the remote machine, because it's an X app, that's a lot slower though. You really just want to run the X apps for the best performance.
Last edited by DavidPhillips; 06-20-2003 at 01:46 PM.
While this is not a remote desktop, unless you start a window manager from the xterm. It is by far the best way to be able to run X apps on a remote machine and still maintain security.
If you want a remote desktop I would go with vnc over ssh or setup your local machine to where you can run xinit without starting a window manager and then crank up wmaker or other wm from the ssh login.
On the client machine (the one you are sshing from), edit the /etc/ssh/ssh_config file and make sure the following lines are enabled:
ForwardAgent yes
ForwardX11 yes
Make sure you don't have a local (~/.ssh_config) file that overrides these directives.
From an X session on your client machine, ssh in to your host machine and run an X program (xv, for example). xv should pop up on your local machine. It's running on your host machine. . . Do the same for other programs.
I tried this:
xinit -e ssh -X remotemachine gnome-session -- :1
however it just opened up a new xsession on the local machine, rather than the remote machine!
remotemachine being the FQDN (domain name) or ip address of the machine you are connecting to, and wmaker being any valid window manager on your system
I have only tried the following
Slackware 9.0.0 connecting to RedHat 7.3
Last edited by DavidPhillips; 06-24-2003 at 09:33 PM.
One thing that might cause a problem is trying to run the command from within X. ctrl_alt_F1, F2, F3, etc. out to a terminal and try it there if your getting errors in an xterm.
Distribution: Redhat v8.0 (soon to be Fedora? or maybe I will just go back to Slackware)
Posts: 857
Rep:
Okay... I am getting a bit confused here.. but Msound, are you trying to run an entire nested Xwindows session on your remote desktop.. or are you simply trying to have Xwindows applications that are running on the remote server displayed on your local machine?
I agree with the posters above, in that if you are trying to run an entire desktop, then VNC is definitely the way to go. "man vncserver" and "man vncviewer" for all the info you need.
If however, you just want to have say something like Mozilla running on the remote server, but displaying on your local machine... then it should work by default with RH v7.3. Just ssh into the remote server and issue the command line command for whatever app you want to run (i.e. "mozilla", etc) and it will by default display on your local machine.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.