10

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?
quack quixote
  • 42,186
  • 14
  • 105
  • 129
Alex B
  • 2,047
  • 3
  • 17
  • 17

3 Answers3

9

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) by using sudo vi /private/etc/ssh/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.)

SebMa
  • 1,573
  • 2
  • 19
  • 25
Arjan
  • 30,974
  • 14
  • 75
  • 112
4

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).

Doug Harris
  • 27,333
  • 17
  • 78
  • 105
  • 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 03 '09 at 13:03
  • I wish I could avoid using it. It seems VNC remains the only alternative at this point. – Alex B Oct 05 '09 at 15:36
-2

Just use

su -lm <usrname-to-proxy-for>

to enter into a shell where no X11 issues will occur. See manpages for details about the '-m' option.

Sathyajith Bhat
  • 61,504
  • 38
  • 179
  • 264
  • *-m Leave the environment unmodified. The invoked shell is your login shell, and no directory changes are made.* — how is that related to the question? – Arjan Jun 17 '12 at 08:31