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.

6
  • 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. Commented Aug 31, 2011 at 14:36
  • Can I ask why you want to avoid VNC? Network lag issues? Commented Sep 2, 2011 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. Commented Sep 2, 2011 at 18:08
  • By the way you don't have to install X11 by macports... X11 comes with OS X.
    – Yuji
    Commented Sep 3, 2011 at 18:08
  • Ah hah, so your objection to VNC isn't down to any VNC issues, but because of the screen constraints? Commented Sep 4, 2011 at 17:57

5 Answers 5

10
+50

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.

3
  • Great, this seems to be what I want! Now I have another motivation to upgrade to Lion. I'll test soon and probably accept this as the answer. Thanks! Commented Sep 3, 2011 at 9:51
  • Darn, I've just upgraded and I get the login screen via VNC. But it does not want to take my keyboard stroked. Thus I can not login :( Commented Sep 4, 2011 at 9:38
  • That is very odd - what VNC client are you using?
    – cftarnas
    Commented Sep 6, 2011 at 6:49
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.

7
  • 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? Commented Aug 28, 2011 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). Commented Aug 28, 2011 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. Commented Aug 29, 2011 at 3:30
  • As Sylvain explained this is not possible on the Mac. The underlying architecture of the OS does not permit this type of use. Commented Sep 2, 2011 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
    Commented Sep 3, 2011 at 4:21
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.

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.

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.

You must log in to answer this question.

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