Broken X11 connections from remote machines

Hi,


I regularly use terminal to ssh (ssh -Y) to a linux box (slc5) and have the x-connections forwarded to my local machine (a macbook pro running OS X 10.7). When I connect to the remote machine, the x-connections are forwarded without error but after some time (usually between 5 minutes and an hour), the x-connection becomes broken. The message on the remote terminal is:


X connection to localhost:10.0 broken (explicit kill or server shutdown).


I've looked in Console to check for error messages and the only error I've found is in the system log:


Aug 26 17:16:32 pb-d-128-141-138-181 login[11005]: USER_PROCESS: 11005 ttys004

Aug 26 17:16:33 com.apple.launchd.peruser.501[123] (0x10f517fb0.anonymous.X11.bin[7600]): The following job tried to hijack the service "org.x.X11" from this job: 0x10f51b790.anonymous.X11.bin

Aug 26 17:16:33 pb-d-128-141-138-181 login[11005]: DEAD_PROCESS: 11005 ttys004


I purchased this macbook in July 2011 with Snow leopard installed and this problem was present at the beginning. I then upgraded to Lion and the problem persisted. My previous machine was an IBM laptop on which I performed the same taskes with no incidents of broken x-connections so I don't think the problem is on the remote side of things. I have yet to find a consistent pattern for when the break occurs. I've searched the forums but I haven't been able to find anyone with the same problem but I may not be searching with the correct terms.



Does anyone have any thoughts on what this could be or other log files that I could check?


Thanks!

MacBook Pro, Mac OS X (10.7)

Posted on Aug 26, 2011 9:22 AM

Reply
14 replies

Sep 1, 2011 11:06 PM in response to JoshMoss

Hi Josh,


I am also having the same problem as you. I use ssh with -X to log into a remote machine, and lately (since Lion) it has been exiting with the same error. I find it is usually a time issue, where it will work everytime I need it to when I first log-in but then at some point it fails.


I have used the same configuration since Tiger with no problems, but it is consistent with Lion. I don't know of any solutions other than just logging off and logging back in... but this isn't really ideal.


I haven't made any configuration changes to X11 that I know of.


--Jeff--

Sep 13, 2011 6:08 AM in response to JoshMoss

I recall someone reporting this in the past couple months, but that thread died down. That reporter said that the existing connections still worked. Is that the same for you (ie: if you have an xterm open, it stays open and responsive, but you can't create a new one)? If that's the case, this has nothing to do with X11 and is probably a bug in sshd on the remote machine.


--Jeremy

Sep 14, 2011 5:13 AM in response to JoshMoss

Apparently the solution to this problem is to use

ssh -Y

when connecting to the remote machine instead of

ssh -X


see http://lists.apple.com/archives/X11-users/2011/Sep/msg00011.html


this has to do with openssh bug 1785

http://lists.mindrot.org/pipermail/openssh-bugs/2010-June/009251.html

which was resolved in openssh 5.6 (included in Lion)


The solution was found by Greig Cowan, and the problem diagnosed by Adrian Umpleby.

Dec 21, 2011 7:40 AM in response to -jim

I have spen many hours trying to get OS X (Lion and Lepord) to work with remote hosts.


I have tried all kinds of things including ssh -y none of them work.


If I

ssh -y root@remotelinuxhost


And get to a prompt.

Run:

xeyes &

I get:

DISPLAY is not set


I set the display as:

DISPLAY=10.1.52.188:0

export DISPLAY

(Which I understood should NOT be necessary with ssh -y)


xeyes &

No protocol specified

Error: Can't open display: 10.1.52.188:0


Running form a session on my local machine seems to work fine.

xeyes &

All seems to work.


Any help would be appreciated.


Thanks

-jim

Dec 21, 2011 8:08 AM in response to -jim

ssh -y root@remotelinuxhost


ssh lowercase -y is NOT the same as ssh capital -Y. Was that a typo on your part? They again, since you are getting "DISPLAY is not set" would explain that you were NOT using capital -Y, which forwards your current system's X11 display to the remote.


With Mac OS X you should NEVER manually set your DISPLAY environment variable, neither on the Mac, nor in a remote system's shell initialization files (unless you really know what you are doing on X-Windows). You should use ssh -Y (or ssh -X) to forward you Mac OS X X11 display to the remote system.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Broken X11 connections from remote machines

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.