Installing XFree86/XDarwin for MacOSX

[Note: these instructions worked for me on 10/8/2001 with MacOS 10.1 installed. There's no guarantee they'll work if any of the files I downloaded get changed, so you may want to look at the pages I link to for more recent information. And it's possible that there are other things that could go wrong, too...]

There are two things that need to be installed in order to be able to use X-Windows on MacOSX. XFree86 is an X-Window system for which there is a MacOSX version that can be downloaded for free. XDarwin is an application that provides a graphical user interface that lets you start X from within the MacOSX (Aqua) environment, and that'll make it possible for the X-Windows to appear on your screen without X taking over the whole screen. It can also be downloaded for free. There is also another X system from Tenon for MacOSX, but it isn't free and I haven't tried it.

First you should become root:

Then you need to install XFree86

Now you can get XDarwin1.0.4.1.tgz

Download it from http://prdownloads.sourceforge.net/xonx/XDarwin1.0.4.1.tgz

cd ~YOURUSERNAME/Desktop [or wherever your browser puts downloaded files]
cp XDarwin1.0.4.1.tgz /
cd /
tar zxvf XDarwin1.0.4.1.tgz
rm XDarwin1.0.4.1.tgz

For more details see http://mrcla.com/XonX/

Now configure a few things

Create a file /usr/share/init/tcsh/path and put these lines in it:

  setenv PATH "${PATH}:/usr/X11R6/bin"
  setenv MANPATH "${MANPATH}:/usr/X11R6/man"
Put these lines at the end of /etc/ssh_config (or uncomment and edit the relevant lines) to get xforwarding/xauth working (i.e. when you ssh to a remote computer the DISPLAY variable will be set automatically, and xauth cookies will be made and used on the fly.)
  Host *
         ForwardX11 yes
         Protocol 2,1
If you want to have your own .Xresources file, e.g. in order to add scrollbars, and you don't have the developer tools installed, you will not have /usr/bin/cpp, so you need to add -nocpp in these two lines in /usr/X11R6/lib/X11/xinit/xinitrc:
  xrdb -nocpp -merge $sysresources
  xrdb -nocpp -merge $userresources

You may also want to change the size of the console in /usr/X11R6/lib/X11/xinit/xinitrc:

  exec xterm -geometry 80x12+0+0 -name login

And if you're experiencing problems with your @ character, add the following line to
/usr/X11R6/lib/X11/xinit/xinitrc
just before the line that starts the window manager, usually "twm &":

xmodmap -e "keycode 27=2 at currency currency"
Type "exit" to get out of the root login.

Logged on as yourself, configure .Xresources

Make a ~/.Xresources file to get scrollbars:
  *ScrollBar:                     true
  *Thickness:                     16
  *Scrollbar.foreground:          LightGray
  *Scrollbar.background:          DarkGray

Starting XDarwin

To start just click on XDarwin in /Applications (you'll probably want to put this in the dock) and select "rootless mode".

Use the XDarwin Preferences to enable mouse button emulation (with option and command keys) and to select "rootless mode" (in which X doesn't take over your whole screen) as your default mode.

You'll also want to remove all the stuff that got downloaded into your Desktop directory.

Here are instructions about a few other MacOSX things.


Last modified: October 8, 2001
Susanne Riehemann (sr@csli.stanford.edu)