It would be great to be able to x tunnel over ssh; why does one have to use XQuartz (etc) instead?


The simple answer is: Terminal is a terminal emulator -- it's not an X11 server. It exists to provide a text-based communication end point between your Mac and other machines.

Terminal is no more an X11 server than gnome-terminal on Linux is or cmd on Windows is. Which is to say: it isn't an X11 server at all. You need to be running an X11 server on your local machine to be able to have tunneled, graphical, X11 applications draw their UIs on your Mac. This isn't actually different for Mac from something like Linux, it's just that Linux, by default, is always running an X11 server for drawing your desktop so it's handled a little more gracefully than it is on the Mac. You just have to open up your X11 server's permissions and ssh tunneling and X11 forwarding on a Linux desktop seem to work.

The XQuartz server you run on OS X simply gets you the missing X11 server you need on your OS X session to enable drawing the forwarded UI commands on your OS X desktop. This isn't something an Terminal application ever would, or ever should really, implement. It's not part of being a Terminal. It's a wholly separate thing.

I also want to address something you said in your question:

It would be great to be able to x tunnel over ssh

I'm assuming you mean "it would be great to do X11 forwarding from an ssh session started in Terminal.app to my running XQuartz server". You can do this!

When you use ssh in Terminal.app simply include the -X option to enable X forwarding and your Mac will start XQuartz automatically. No need to use the terminal app in XQuartz, which pretty much sucks.

You can also edit ~/.ssh/config and add:

ForwardX11 yes

to that file to enable X forwarding by default for all ssh sessions. You can even launch X programs on the remote machine in to the background like so:

ssh username@remoteserver -f -X xeyes

That works from Terminal.

  • Thanks! That makes a lot of sense. But at the same time, xquartz is just a terminal which also supports x11... so it seems like it would be better to add x11 support to terminal, than to entirely reproduce a (much worse) terminal-emulator with x11 – DilithiumMatrix Aug 28 '14 at 18:57
  • 1
    No, XQuartz is not a terminal. It is primarily an OS X-friendly implementation of an X11 server and it happens to ship with some X11 programs, one of them being a terminal emulator that draws its UI over X11. As I've said above: adding X11 support to Terminal isn't possible because terminals, no terminal, supports X11. Terminals don't exist to draw sprites on the sceen, full stop. – Ian C. Aug 28 '14 at 18:59
  • 2
    It can't support X11 because a terminal program doesn't contain the necessary (massive) software internals to draw sprites on a screen. Marrying the two breaks good software design principals and just bloats the terminal app. There's no reason the X11 terminal program in XQuartz can't be as good as Terminal other than time and effort from the people who happen to want to work on it. – Ian C. Aug 28 '14 at 19:27
  • 1
    @zhermesI updated my answer to show you how to do X forwarding from your ssh sessions initiated in Terminal.app. You still need the XQuartz X11 server but you do not need to use it's lousy terminal emulator. – Ian C. Aug 28 '14 at 19:36
  • 2
    You can get more powerful terminals than xterm that run under X11 e.g. rxvt – mmmmmm Aug 28 '14 at 20:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .