xorg - Is it possible to run mac osx apps on a X11 server?

27
2013-07
  • cibercitizen1

    I can successfully open a ssh -X connection from host.home to host.work (both Mac OS X). X11 is running on host.home. When I start xterm or xeyes on host.work I see it on host.home, but if I start macvim it runs on host.work, not in host.home.

    Is this possible, or only X11 enabled programs may be used for remote interaccion?

  • Answers
  • Renan

    No, only X11 programs can be used remotely. Mac OS X native apps use a completely different toolkit. From this in the Apple Stack Exchange:

    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 a (not as good) solution you could use VNC.

  • Kyle Jones

    Mac OS apps don't use the X protocol. But the de facto standard for remote GUI interaction is VNC, which OS X supports natively. Enable Screen Sharing under System Preferences -> Sharing and you can use a VNC client running locally under X11 to interact with the GUI on the remote Macintosh.


  • Related Question

    osx - Running X11 Server on Mac OS X - and connecting from a remote machine
  • Jonathan Leffler

    Originally asked on SO - transfer to SU suggested on SO, but transfer made manually.

    I have a Windows XP laptop, and I can run the Cygwin X11 server on there (script startxwin.bat, IIRC). I also use a remote machine - it happens to be a Solaris 10 SPARC machine, about 1800 miles away - that can be called xclient.subdom2.example.com for the purposes of this question.

    For better or worse - mostly worse - I use xhost +xclient.subdom2.example.com on the laptop to allow anyone who uses the remote machine to display their X client on my machine. Fortunately, I'm the only person who uses the Solaris machine on a regular basis and the corporate security is stringent enough that I can live with the security risks.

    From the XP laptop, I then remotely connect to the X client machine, and set environment variable DISPLAY=xplaptop.subdom1.example.com:0.0 and can run X client programs on the remote machine and see the display happily, if a little slowly on occasion, on the XP laptop. (Depending on the length of the DHCP name assigned to the laptop, I've occasionally had to resort to an IPv4 address instead of the machine's FQDN.)

    I also have an Apple MacBook Pro, and I want to replicate the functionality of the XP laptop on it. Unfortunately, I have not yet been able to work out what magic incantation is needed to get the X11 server to run satisfactorily on it. It appears that simply clicking on the X11 server in /Applications/Utilities is not sufficient. Running the xhost command again (with DISPLAY=macpro.subdom1.example.com:0.0) doesn't seem to do the trick.

    Can you suggest what the incantations needed are? Or suggest pointers to where the answer is spelled out in words of one or two syllables?


    Also - and very much in the bonus question category - how readily and well does the X11 server react to changes in networking (between corporate direct wired DHCP connection and wireless Airport at home with connection to corporate via a VPN)? Is it a 'restart in the new environment' issue, or will it manage to detect the changes automatically?

    I would also consider other ways of achieving about the same result - such as VNC or Mac equivalents - if they are easier to set up. I believe that VNC is installed on the Solaris box; it can be if it is not.


  • Related Answers
  • jtimberman

    X11 itself is not a very secure protocol.

    You should use X11 forwarding with SSH. This will encrypt the connection and provide better security.

    First, enable the ssh daemon on your Solaris system. Solaris 10 should come with SSH preinstalled. See if the process is running with ps -ef | grep ssh

    On your MacBook Pro, run Terminal.app, then use ssh -X xclient.subdom2.example.com to connect to the Solaris system and start an X11 tunnel. You can launch X11 programs from the Solaris system and they will start on the MacBook under X11 automatically.

    To do X11 forwarding on your Windows system, you'll need two programs. Xming which is a lightweight X11 server, originally from Cygwin, and puTTY, an SSH terminal program for Windows. You'll need to enable X11 forwarding in puTTY.

    For better performance, you'll want to enable compression. This is done with the ssh program on OS X using the -c option (ssh -cX), or in puTTY on the SSH Panel (section 4.18.3 enable compression).