11

I'm used to working on Unix/Linux and recently moved to Mac. In used to be able to do this:

derick@linux1:~$ ssh -X linux2
derick@linux2's password:
derick@linux2:~$ xclock

I've install X11 from maxports and I can do the same from my mac. If I try the reverse by ssh-ing into my mac from linux I can only run certain apps:

  • /usr/X11/bin/xclock works fine

  • Something like /Applications/Preview.app/Contents/MacOS/Preview opens the GUI on the mac.

    It seems that this is not possible on a mac? If not, how do I run an application remotely (on a mac) with a local (linux) display? Do I need some third-party app?

Update: To be more precise: I have synergy and use Mac for coding. On my linux PC I would like to see another application's display (GUI) from Mac. Thus, 'live screen sharing' apps like VNC will not work.

For example I'm working on my mac in app A (say Word) and want to see the output of Excel (running on mac) on my linux PC next to me. (Simulating a dual screen via the network). It worked nicely on linux, hoping for a solution for mac.

  • If there is not a solution via SSH I would also be interested in that. The problem is that I want to run a local app's display on a PC via the network next to me like I used to do with linux. – Derick Schoonbee Aug 31 '11 at 14:36
  • Can I ask why you want to avoid VNC? Network lag issues? – Nicholas Smith Sep 02 '11 at 13:43
  • I'm currently working on the Mac, thus the screen is "occupied". I want to run another app on the mac with the output displayed on the PC next to me. Like I did with linux. Hoping to see a solution on mac. – Derick Schoonbee Sep 02 '11 at 18:08
  • By the way you don't have to install X11 by macports... X11 comes with OS X. – Yuji Sep 03 '11 at 18:08
  • Ah hah, so your objection to VNC isn't down to any VNC issues, but because of the screen constraints? – Nicholas Smith Sep 04 '11 at 17:57
  • Quite related: http://apple.stackexchange.com/questions/100829/how-to-launch-a-gui-application-in-another-users-graphical-session/102105#102105 – cregox Jun 17 '14 at 06:38

5 Answers5

17

The Mac OS X native application do not use the X protocol for the rendering, but the Mac specific protocol. So you cannot use ssh X protocol forwarding as you could with a Linux workstation.

As you discovered, the reverse is not true, you can install an X server on Mac OS X and have the Linux program appear on your Mac.

What you can do is use either Mac own desktop sharing facility or install a VNC server. Then from your Linux box, you connect to your Mac through VNC instead of ssh.

  • Thanks for info. What I want to know if there is some similar functionality I can use on the Mac. For example can I use the desktop sharing facility from linux1 while I'm working / logged in on my mac? – Derick Schoonbee Aug 28 '11 at 15:33
  • Yes, you can run a VNC server on Linux and connect it from Mac with a VNC client (there are some free VNC client on the Mac, and free VNC server on Linux). – Sylvain Defresne Aug 28 '11 at 22:43
  • Hmm.. VNC does not cut it: I'm working on my mac in app A (say Word) and want to see the output of Excel (running on mac) on linux PC next to me. – Derick Schoonbee Aug 29 '11 at 03:30
  • As Sylvain explained this is not possible on the Mac. The underlying architecture of the OS does not permit this type of use. – Samuel Mikel Bowles Sep 02 '11 at 19:57
  • 3
    See my answer, but with Lion it is possible if you use a different user on the Mac for the VNC session. – cftarnas Sep 03 '11 at 04:21
  • @Derick - If I understand your request correctly, you can easily use Apple's X11.app to use remote Linux applications on your Mac. It doesn't get installed by default, but you can install it optionally from your OS X DVD. – Kiezpro Sep 03 '11 at 17:45
  • Thanks Kiezpro. So far @cftarnas gives the best / most accurate solution. – Derick Schoonbee Sep 03 '11 at 21:34
10

So if I am not mistaken the the problem you have with VNC currently is that it is sharing the current Mac user's screen with apps open that you don't want to see on your other computer? Lion introduces the ability to screen share users that are logged in the background. Quoting the text from the link:

  • Enable Screen Sharing and set a VNC password.
  • Take note of your computer’s IP address.
  • Fire up a VNC client on another machine.
  • Connect to your computer’s IP address along with the password you set earlier.
  • You will see the Mac OS X login screen that appears when you first start the computer. If you log into the currently active user you will be controlling the computer’s screen. If you select a different user, you will be logged into that user’s desktop in the background. It will not affect what what is seen on the physical computer screen.

You will likely just need to create another user for sharing.

cftarnas
  • 656
7

As Sylvian mentioned, you can't run your Mac apps and display them on Linux. The best you can do is VNC. You'll see the whole screen, not just one app.

Enable a VNC password in Screen Sharing Preferences:

Screen Sharing Preferences

You can then use any VNC client application on Linux.

bahamat
  • 3,535
0

Getting a bit creative, but you can also run a java app using VNC that either has a http server, or in my case uses a loop to look for a file and create that file using SSH.

Here is my java app.

Erik B
  • 101
0

You're a little out of luck, but ScreenRecycler is going to get you as close as possible. Runs over VNC but convinces OS X the VNC connection is actually a separate monitor, it should allow you to get close to what you need. I've used it, it's pretty good, there's a free trial then it's quite cheap. I stopped using it purely because I was on a crappy network and there was too much latency unless I was directly networking the two.