Run apps on Apple's X11 server from other machines

Jan 14, '03 09:30:45AM

Contributed by: booger

One of the great things about X11 is that it operates as a networked client/server application, so you can allow other hosts to run X11 applications using your server to display. Here's how to configure OSX to allow this (assuming you have Apple's release of X11 installed):

  1. Add a new rule to your firewall (System Prefs -> Sharing -> Firewall -> New) with the port name = "X11" and the port number = "6000"
  2. Start X11
  3. In your xterm type xhost +
And that's it. Now, for example on a local UNIX machine you could do the follwing:
 $ DISPLAY=myosxmachine.foo.com:0.0
$ export DISPLAY
$ xv
to run an instance of the image viewer xv on the OSX machine's X11 server.

What you've done is to A) Open the firewall for port 6000 (the X11 port) and B) Allow anyone to use your X server (xhost+). Be aware of the implications of doing this however, and make sure you read up on the 'xhost' command and how to limit access only to the hosts you trust (tyep man xhost).

[Editor's strong caution: Please see the comments for why this is a Bad Thing to do! The right way to use this command is with an actual IP number or host address in the xhost command, as shown in the comments. You can also use the ssh syntax shown in another comment ... my apologies for running this as is without testing and researching first.]

Comments (19)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2003011406304544