up vote 4 down vote favorite
2
share [g+] share [fb]

I need run Mac applications on a remote Mac machine and display it on a local Linux machine's X server (a lot of articles on the Internet seem to be detailing how would you do it the opposite way).

$ ssh -X mac-box
$ cd /Developer/Applications/Xcode.app
$ ./Contents/MacOS/Xcode
Sat Oct  3 20:41:26 mac-box.local Xcode[15634] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
^C
  1. My $DISPLAY variable appears to be empty. What should it look like so that forwarding works correctly?
  2. Can I run OSX applications this way at all?
link|improve this question

38% accept rate
feedback

2 Answers

up vote 3 down vote accepted

If a Mac's Aqua was X, then you would not need to run X (XQuartz) to start other X programs on a Mac...

So: no, I think you cannot do this.


But, to help you get started, I'd first try to get true X programs forwarded to your Linux machine:

  • On your Mac: install XQuartz if you've not yet done so (like XQuartz 2.3.4 from optional installs on the OS X 10.6 DVD, or download the latest from the XQuartz project).

  • On your Mac: change X11Forwarding no into X11Forwarding yes (and ensure there's no hash (#) in front of that line) using sudo vi /private/etc/sshd_config, or using a sed command from Apple's Enabling X11 Forwarding. This will also ensure the DISPLAY variable is set automatically.

  • On your Linux machine:

    ssh -Y user@mac-box
    xterm
    

(Some next steps might then include Googling for Xephyr (or the older Xnest). And if you run into keyboard issues: Google xmodmap, or use xev for debugging. Or for font issues: Google xfs and xset +fp tcp/mac-box:7100. But I doubt you can run Aqua programs this way.)

link|improve this answer
Unfortunately you are right. I can't run Xcode and iPhone simulator via SSH, even though I can run xterm. Also, I did not need to install XQuartz on stock 10.6 install. – Alex B Oct 5 '09 at 15:34
feedback

It sounds like your main goal here is to view running Mac applications on a linux machine. Arjan is right, X forwarding won't work for this.

You should enable Screen Sharing in the Sharing pane in System Preferences. This will turn on a VNC server. Using a VNC client on your linux machine, you'll be able to see your Mac desktop. This article shows how to set it up on the mac side (steps 1-3), goes on (a bit too much) about setting up dyndns and opening ports in an Airport base station and then has a tiny bit at the bottom about setting up the client side (steps 20-21).

link|improve this answer
And there's also many programs out there that only share a single application (rather than the whole desktop). I think one can even do that using the latest Skype, cross-platform. (I am not sure if Skype also allows one to control the remote machine, rather than only peeking to its screen.) – Arjan Oct 3 '09 at 13:03
I wish I could avoid using it. It seems VNC remains the only alternative at this point. – Alex B Oct 5 '09 at 15:36
feedback

Your Answer

 
or
required, but never shown

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