Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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.
I don't know what exactly am I missing here, but I am pretty sure I am doing something wrong.
OK so I have two Linux computers (A and B) that are networked through the router and I want to be able to run X server on one of them with application from the other one. So, local Xserver, remote application. This is what I do:
1. On A: xhost +B
2. On A: ssh -X A (type in login and password)
3. On B, logged from A: export DISPLAY="A:0.0"
4. On B, logged from A: startx
When I do this, my Xwindows actually open on B, the remote computer. What am I doing wrong?
Last edited by frankie_DJ; 03-16-2006 at 10:41 PM.
So, if I understand what you want to do, you want to be able to do this:
You are sitting in front of A, you want to log onto B with SSH. Then you want to run a program on B via SSH and see the window in front of you on A?
If that's the case you need to do this:
* Make sure the SSH server running on B has X11 forwarding enabled. Check the "/etc/ssh/sshd_config" file for this option. (If you had to enable the option, you need to reastart the SSH server (or reboot))
* On A, run "> ssh -X B", login and password. You should now be logged into B.
* Type the name of the program you want to run on B and see on A. For example: "> firefox". This may be a bit slow depending on your network, etc, but you should see the window for your program pop up.
I do this sort of thing on a daily basis, and I never have to mess with any DISPLAY variables or anything. I would think something was set up really strange if you needed to. You also shouldn't need to mess with the "xhost" command at all.
The reason the startx command isn't doing what you want is because the startx command starts an X server. An X server is what communicates with the graphics hardware to draw to the screen. So, if you run startx on B, no matter how you set up your DISPLAY variable, the startx command on B will always draw to B's screen.
There is another method to remotely display windows on other X servers, but it is a little more complicated, and not encrypted at all. Because you are using SSH, you can skip the whole mess and just use SSH's X11 forwarding feature.
This is wrong, it causes X programs to not use the SSH tunnel. SSH sets DISPLAY to correct value automatically (typically something like localhost:10.0).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.