Can no longer use X11 with ssh. Have XQuartz2.7.7 installed. Logging in with X11 via ssh gives the warnings
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
In my own system, echo $DISPLAY
gives
/private/tmp/com.apple.launchd.GuewxwWwKS/org.macosforge.xquartz:0
However, when I try xauth generate $DISPLAY . trusted
, I get the error
xauth: (argv):1: bad display name "/private/tmp/com.apple.launchd.GuewxwWwKS/org.macosforge.xquartz:0" in "add" command
Any ideas in how to fix this?
Best Answer
UPDATE
Developer Jeremy Huddleston Sequoia announced yesterday that this problem is solved in XQuartz 2.7.8_beta2:
The bug report is closed and marked as fixed:
If you can't (or don't want to) install the beta, you can still use the workaround I explain below.
ANSWER
Analysis
(scroll down for the workaround section)
My first thought was "the
DISPLAY
variable is wrong". But it's not.As it turns out, on OS X 10.10 Yosemite (and back to 10.8 Mountain Lion) the
DISPLAY
variable stores alaunchd
socket path:instead of the familiar display name:
(I've added some information about the
hostname:displaynumber.screennumber
format at the end of this answer.)This means that
xauth
has to know how to deal with this special incarnation of theDISPLAY
variable, and as of Mavericks, it did, but the socket used in Yosemite has a different path (more precisely:/private/tmp/com.apple.launchd.XXXX
instead of/private/tmp/launch-XXXX
), andxauth
breaks.This bug was reported to the XQuartz team on Nov 18 2014 (3 months ago) (http://xquartz.macosforge.org/trac/ticket/2068):
According to the bug description it is to be solved in XQuartz 2.7.8, which is 4 months late (see the project roadmap page at http://xquartz.macosforge.org/trac/roadmap).
The patch that fixes the problem was committed on Dec 31 2014 to the freedesktop.org project (http://cgit.freedesktop.org/xorg/app/xauth/commit/parsedpy.c?id=f990dd936b5fd1a40290bb88cde517a0ac38f823):
So it's only a question of time until this patch finds its way into the next release of XQuartz.
Workaround
(tested on OS X 10.10.2 Yosemite.)
Add:
to
~/.bashrc
and either start a new Terminal window or source it (. ~/.bashrc
) in your current Terminal session.This alias first symlinks the socket path to
/private/tmp/launch-XXX
(for exampleln -fs /private/tmp/com.apple.launchd.GuewxwWwKS /private/tmp/launch-GuewxwWwKS
) and then startsssh
:For the curious, traditionally, the X server's display name has had this form (from
man X
on Ubuntu): The X server's display name has this form:where: