Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

X11 forwarding request failed on channel 0

Got this error when attempting to use XQuartz (Mac X11 client) to access a LINUX box (Centos 8).


Main issue was not having "xauth" installed on the LINUX box; once I did that (on CENTOS it is "yum install xauth", debian systems including Ubuntu use "apt-get install xauth".


Of course to install on the LINUX box requires sysadmin (root) privs.


I'm using OSX Ventura on the Mac although this should work on earlier versions of OSX; ditto with CENTOS 8 (should work on Redhat/Ubuntu/Debian/etc).



Posted on Aug 16, 2023 9:46 AM

Reply

Similar questions

4 replies

Aug 16, 2023 1:55 PM in response to Charlie_Lindahl_TAMU

Make your Linux connection using ssh


ssh -Y user@linux.system.address


This will automatically setup an X11 tunnel, initialize the DISPLAY environment variable that will look something like localhost:10


YOU MUST NOT, define your own DISPLAY environment variable. ssh will do that, if you do your own define in your shell initialization scripts will destroy what ssh has setup.


You DO NOT need xauth.


I have used XQuartz and ssh -Y for years to my Linux hosted development system, and it works great.


After I make a connection, I do make sure it is working by running xclock on the remote Linux system, as it is a quick and easy way to verify the ssh X11 tunnel is properly established and is talking to XQuartz on my Mac.


If you have JUST installed XQuartz, you will need to either logout of the Mac GUI and login again, or just reboot, so that XQuartz will establish the necessary hooks into the GUI environment that allows it to open and display windows, and to pass the local DISPLAY information to ssh.

Aug 16, 2023 2:19 PM in response to BobHarris

Ah, now I remember the "-Y" flag.


Did you have to set the X11Forward flag on your server too? I have out-of-the-box Redhat RPM that had that *commented out* on the server side.


I like to use "xeyes" as my test :-)


It's been YEARS since I used X11, but I seem to recall some sort of compression argument to SSH as well ...


The Linux server (CENTOS) seems to be a bit sluggish; it can't be my network speeds 'cuz I'm on Internet2 to my desk, at least 1Gbit/sec. It *is* a virtual machine, though, so it may be slow 'cuz of the RAM or the priority of the VM in our cloud system(s).


Any thoughts on response speed(s)?


Aug 16, 2023 2:46 PM in response to Charlie_Lindahl_TAMU

ssh -C -Y user@linux.system.address


The -C is compression.


I do not use X11 all that often, but my company has an X11 source code control merge conflict resolution tool, and it helps to have that vectored back to my Mac.


I have found that the distance between my Mac and the Linux system matters (more than bandwidth). In my case, my Hosted Linux development system is about 2,000 miles away, and the lag time adds up when you are going through multiple router hops between me and the development system.


ALSO, some X11 based apps are very chatty, and send lots of little messages to do anything. These X11 apps tend to be slow and sluggish from 2,000 miles away. Other apps are less chatty (gvim for example), and from 2,000 miles away, it is mostly usable (still a little lag, but not terrible).


Then again, when the Linux system is in the same building and accessible over gigabit Ethernet with very few router hops between my Mac and the Linux system, the X11 apps are rather responsive. Even the excessively chatty ones.


If I have to do a lot of X11 based work on a Linux system, I'll fire up a TigerVNC session on my Mac and connect to the Linux system. It seems to work better 2,000 miles away than X11. But most of my work can be done via ssh connections, so I rarely fire up TigerVNC. I have used other VNC clients over the years, but I've found TigerVNC does the best with Copy & Paste between Linux and my Mac.

Aug 16, 2023 3:02 PM in response to BobHarris

Yes, I like VNC as well.


But apparently the community VNC can be flakey if youhave multiple users/desktops; I'm in the process of evaluating the commercial/enterprise RealVNC to see if the speeds are better and the connections more reliable.


I stumbled upon (and remembered) about X11 when I found that the RealVNC installer programs like a GUI interface; their CLI-based stuff is pretty convoluted.


X11 forwarding request failed on channel 0

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