Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've done some searching and found that it seems to be possible to forward X11 apps to a mac machine over ssh (i.e. ssh-ing into a linux box and launching an X11 app and having it show up on the mac's display).

What I'm wondering is if this can be done in reverse (i.e. ssh-ing into a mac machine and launching an app and having it show up on a linux display). If this is possible, how do I go about setting it up, and more importantly which OS X apps will this work for?

share|improve this question

5 Answers 5

up vote 2 down vote accepted

These instructions should work, but I've just spent the last hour and haven't got it to work yet.

Also, you may want the latest version of X11 for Mac, XQuartz.

edit

XQuartz 2.3.3.2 (xorg-server 1.4.2-apple42), has, under Preferences, a Security tab, with an option called "Allow connections from network clients". I suspect that this setting will make a difference.

share|improve this answer
    
I'm surprised to have given the accepted answer, as I still haven't gotten this to work. Did it work for you? –  Clinton Blackmore Jun 1 '09 at 12:51
    
In fairness, I ended up using VNC since the app my users wanted to use wouldn't have worked with X11 forwarding anyway. However, your answer currently has what seems to be the most information on actually getting it to work so... –  Zxaos Jun 1 '09 at 17:39
    
Well, fair enough. I'll have to play with it some more some time. –  Clinton Blackmore Jun 1 '09 at 19:59

In X terminology, I believe you want to run a Mac client from a Linux server. So you certainly don't need to install an X server on the Mac.

What you do need to do, as mentioned in the hint at macosxhints.com, is edit /etc/sshd_config on the Mac from

#X11Forwarding no

to

X11Forwarding yes

If the Mac runs 10.4 or later, that's all. "ssh -X you@yourmac /usr/X11/bin/xterm" will now work.

If the Mac is still running 10.2 or maybe 10.3 then you have a fair bit more work to configure sshd to load the X11 authentication cookies, because back then the sshd program included in OSX didn't know about the xauth program included in OSX. IIRC, you needed to recompile sshd or use xauth manually.

share|improve this answer

Of course. You will need to setup at least a X11 server and your SSH server. As noted, this will only let you forward apps that run within X. Thus, it's worth looking into vnc, which is crossplatform and apparently included in OS X 10.4+

share|improve this answer
    
I don't think 10.4 had built in VNC. 10.5 does, but it is a bit quirky. –  dmckee May 25 '09 at 21:27
    
    
I stand corrected. –  dmckee May 25 '09 at 22:51

Only X11 apps themselves can forwarded through X11 (so most OSX apps won't work). However, look into remote desktop software. It won't work quite as fast as X11, but should allow most apps to work correctly (OpenGL might not work). This comparison of remote desktop software should get you started.

share|improve this answer

This will only work for X11 apps (hence "X11 forwarding" ;-)), i.e. probably not what you are interested in. Only way to get "real" MacOS X apps to show is using some kind of remote desktop / vnc (which you could tunnel via ssh).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.