Mac OS X 10.4 or later: Remotely-based X11 applications quit unexpectedly or behave erratically

If you use xterm in X11 to connect to a remote server over an ssh session and then execute an X11 application on that remote host, the application could exhibit unexpected behavior (application menus may not work), or quit unexpectedly with a variety of error messages.

For example, if you start a remote ssh session by entering ssh -X remote.host.com and then launch an application, you might encounter messages like the ones listed below by application name.

eclipse-SDK-3.1M5a-linux-gtk install

The program '' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 5931 error_code 3 request_code 38 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

gimp

Gdk-ERROR **: BadWindow (invalid Window parameter)
  serial 26717 error_code 3 request_code 38 minor_code 0
Gdk-ERROR **: BadAccess (attempt to access private resource denied)
  serial 26718 error_code 10 request_code 102 minor_code 0

glade-2

The program won't run or stops responding. The error message given is:

Gdk-ERROR **: The program 'glade-2' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAtom (invalid Atom parameter)'.
  (Details: serial 1058 error_code 5 request_code 20 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
aborting...

However, no error message appears in the local Console application (console.log or system.log files).

Resolving the issue

Use the following command to initiate your remote ssh session in the X11.app xterm session:

ssh -Y remote.host.com

The -Y option "Enables trusted X11 forwarding," which is required to initiate these remote X11 sessions in Mac OS X 10.4 and later. For more information, please see the OpenSSH FAQ (http://www.openssh.com/faq.html#3.13).

Published Date: Feb 18, 2012