View previous topic :: View next topic |
Author |
Message |
ewildgoose Tux's lil' helper
Joined: 02 Mar 2003 Posts: 75
|
Posted: Thu Mar 25, 2004 1:52 am Post subject: Cannot get X11 forwarding working (with startx) |
|
|
I have one gentoo machine with X started via xdm (and running KDE). I can easily open remote X windows back on (say) my windows machine via PuTTy.
However, on my other gentoo machine I start X using "startx", which then boots into KDE. This refuses to let me open remote X sessions. I think the second line of the error message is relevant:
tb root # konqueror
_X11TransSocketOpen: socket() failed for tcp
_X11TransSocketOpenCOTSClient: Unable to open socket for tcp
_X11TransOpen: transport open failed for tcp/localhost:10
konqueror: cannot connect to X server localhost:10.0
Any ideas on how to make this work. I don't really understand the X security stuff, but it looks like an X11 option somewhere controls whether you can make any remote connections at all?
Thanks
Ed W |
|
Back to top |
|
|
gareth Apprentice
Joined: 15 Nov 2003 Posts: 234 Location: UK
|
Posted: Thu Mar 25, 2004 2:02 am Post subject: |
|
|
On the server machine, enter 'xhost +<xxx>' where <xxx> is the IP address or hostname of the machine. See man xhost for more details. |
|
Back to top |
|
|
MacMasta Guru
Joined: 18 Apr 2002 Posts: 545 Location: Anchorage, AK
|
Posted: Thu Mar 25, 2004 2:26 am Post subject: |
|
|
DO NOT DO THAT.
That gets rid of any ssh encryption you might have otherwise have had.
The correct approach is this:
edit /etc/ssh/sshd_config and /etc/ssh/ssh_config to have EnableX11Forwarding (or something like that) say yes.
Connect to the remote machine with 'ssh -X user@host'.
Note the capital 'X'.
Try that, tell me what happens.
~Mac~
EDIT: I am assuming you just want to forward windows, not a whole X11 session at once; that's a completely different beast. |
|
Back to top |
|
|
ewildgoose Tux's lil' helper
Joined: 02 Mar 2003 Posts: 75
|
Posted: Thu Mar 25, 2004 4:03 pm Post subject: |
|
|
Thanks for the thought. Yes, /etc/ssh/sshd_config already has the X forwarding stuff enabled, and putty has the X11 forwarding enabled.
I do have this all setup on one server, so I can compare the configs with the non-working one, and I'm pretty sure that ssh is setup OK. The difference I suspect is that the startx script is setting some different server flags to xdm? Does this sound about right?
Also, can anyone please explain why X forwarding stops working on the good machine if I "su" to a different user? I get an error about "authentication" failed.
Anyone got any good pointers to some docs on how X authentication and net security work? ("good" in this case meaning relevant and "understandable"!)
Thanks all |
|
Back to top |
|
|
MacMasta Guru
Joined: 18 Apr 2002 Posts: 545 Location: Anchorage, AK
|
Posted: Thu Mar 25, 2004 8:22 pm Post subject: |
|
|
I'm a bit confused at to what you are trying to do; are you just forwarding windows, or a whole X11 Session?
~Mac~ |
|
Back to top |
|
|
ewildgoose Tux's lil' helper
Joined: 02 Mar 2003 Posts: 75
|
Posted: Thu Mar 25, 2004 11:21 pm Post subject: |
|
|
yeah, just individual windows (although I would like to know how to forward a whole session to windows...?)
So basically I log in via putty, and then decide I need an app open (kmail for example), just typing "kmail &" works fine on the machine where X is started with xdm, but not on the machine where X was started by logging into the console and then doing "startx".
The point is to remotely access the two gentoo desktop machines from my windows laptop (there are a few reasons why I need to keep the laptop on windows sadly)
Thanks for any pointers. I'm sure that the "startx" script is the problem, but not sure how to tweak the security |
|
Back to top |
|
|
MacMasta Guru
Joined: 18 Apr 2002 Posts: 545 Location: Anchorage, AK
|
Posted: Fri Mar 26, 2004 12:15 am Post subject: |
|
|
...and I'm equally sure it's not the problem, because I have successfully forwarded X sessions from servers that are not only not running X, but have /never/ run X (even though they have it installed).
Post the contents of /etc/ssh/sshd_config and /etc/ssh/ssh_config for the machine that isn't working, please.
~Mac~ |
|
Back to top |
|
|
ewildgoose Tux's lil' helper
Joined: 02 Mar 2003 Posts: 75
|
Posted: Sat Mar 27, 2004 5:50 pm Post subject: |
|
|
Hmm, I see what you mean. I had assumed that X had to be started in order to do remote x connections, but if not, then that can't be the problem...
See below for sshd config, but I compared it to my working machine config and it's almost identical. Client machine is running windows XP using cygwin.
tb root # cat /etc/ssh/sshd_config |grep -v -e '^#' -e '^$'
Protocol 2
UsePAM yes
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
Subsystem sftp /usr/lib/misc/sftp-server
Any ideas..? |
|
Back to top |
|
|
MacMasta Guru
Joined: 18 Apr 2002 Posts: 545 Location: Anchorage, AK
|
Posted: Sat Mar 27, 2004 9:22 pm Post subject: |
|
|
I have the X11DisplayOffSet and X11UseLocalHost lines commented out...I would think that those are the defaults, so the commenting wouldn't matter, but try commenting them out...
~Mac~ |
|
Back to top |
|
|
ewildgoose Tux's lil' helper
Joined: 02 Mar 2003 Posts: 75
|
Posted: Sun Mar 28, 2004 2:11 pm Post subject: |
|
|
Yes, those are the defaults, and they were commented out until just before I posted that config. I only uncommented them to be explicit and just test.
Any other ideas..?? Please...? |
|
Back to top |
|
|
MacMasta Guru
Joined: 18 Apr 2002 Posts: 545 Location: Anchorage, AK
|
Posted: Sun Mar 28, 2004 9:21 pm Post subject: |
|
|
Let's have a look at your error message: post a session, starting from login, up through launching the program and having it not work...
~Mac~ |
|
Back to top |
|
|
ewildgoose Tux's lil' helper
Joined: 02 Mar 2003 Posts: 75
|
Posted: Sun Mar 28, 2004 10:02 pm Post subject: |
|
|
Thanks for the interest. My first post actually has that info exactly. That is literally what I did
I think I have traced the problem though. I re-emerged xfree and it's now working. I think I may have had the ipv6 flag enabled when I first emerged xfree, but the kernel is not ipv6 enabled. Clearly the default in a lot of programs is ipv6 by default
Thanks so much for your help! |
|
Back to top |
|
|
MacMasta Guru
Joined: 18 Apr 2002 Posts: 545 Location: Anchorage, AK
|
Posted: Sun Mar 28, 2004 10:20 pm Post subject: |
|
|
Quote: |
...the default in a lot of programs is ipv6...
|
Including ssh...
~Mac~ |
|
Back to top |
|
|
CopterGuy85 n00b
Joined: 15 Aug 2003 Posts: 27
|
Posted: Fri Jun 04, 2004 5:33 pm Post subject: |
|
|
I know this is an old thread, but maybe someone will see and and can still help me...
Okay, I've got Cygwin installed on my Windows box (Stargate), and I'm able to get everything running nice and smooth connecting to my Linux box (Atlantis) without using SSH tunnelling (Xwin, xhost +atlantis, ssh me@atlantis, export DISPLAY=stargate:0, enlightenment&).
Now, I am trying to get it to work with tunnelling. I enabled X11Forwarding in my server's /etc/ssh/sshd_config, as well as my local ~/.ssh/config. So then I did Xwin, followed by ssh -X me@atlantis, and I saw right above the prompt that it had created an .Xauthority file. When I did echo $DISPLAY it said "localhost:10.0" (if I understand this right, that is the display being forwarded to Cygwin). Now I run xclock, and poof, there's an xclock in Cygwin.
However, when I try to run a window manager such as twm, I get this message:
Code: |
twm: another window manager is already running on screen 0?
twm: unable to find any unmanaged screens
|
All the X apps seem to run just fine, but I can't get any wm's started...any ideas? Thanks ahead for you help |
|
Back to top |
|
|
CopterGuy85 n00b
Joined: 15 Aug 2003 Posts: 27
|
Posted: Sat Jun 05, 2004 5:04 pm Post subject: |
|
|
Well I seem to have found a temporary workaround for this problem...
Apparently it seems that windowmanagers don't like to be tunnelled through ssh, so I gave up on that. Although through experimentation, I found that it *is* possible to tunnel Xnest through ssh So the solution to my problem is (from within my ssh terminal):
Code: |
Xnest -geometry 800x600 -name "Remote X Server" &
DISPLAY="localhost:0" enlightenment &
|
Since my Linux box doesn't do anything but sit there at the moment, this is the first Xserver being run so it gets display 0. Setting DISPLAY right before enlightenment means that everything that gets run from inside my Xnest will pop up inside there, but I can still run applications in my ssh terminal to be sent to Cygwin.
Conclusion: The Xnest method works; it's a lot slower than just sending the windowmanager across the network, but it's still faster than VNC |
|
Back to top |
|
|
MacMasta Guru
Joined: 18 Apr 2002 Posts: 545 Location: Anchorage, AK
|
Posted: Sun Jun 06, 2004 5:06 am Post subject: |
|
|
I think the "can't forward windowmanagers" is because the faux-X server that SSH creates for you considers itself managed by whatever WM is running on the machine ssh'd from...so you can't start a new one.
~Mac~ |
|
Back to top |
|
|
paul138 Guru
Joined: 09 Aug 2002 Posts: 370 Location: Ottawa, ON
|
Posted: Sun Jun 06, 2004 2:00 pm Post subject: |
|
|
It's been my experiance that there is practically no speed difference when using VNC (I use TightVNC).
I've also found that It helps a lot if you don't use something like KDE or Gnome on the remote system. Simple and elegant, twm works just fine for me.
You may want to look at: x2vnc (you wont have to leave your current desktop behind). _________________ Talk is cheap because supply always exceeds demand. |
|
Back to top |
|
|
|