Urania

A blog named for the muse of Astronomy containing musings by an astronomer

XQuartz on MacOS X for the Astronomer

Posted on May 28, 2009 by admin

When I first started this blog, I was using Apple’s built-in X11, but then with the transition to MacOS 10.5, there were some serious issues with Apple’s X11 implementation having to do with the transition from X11R6 to X.org. One of Apple’s programmers started putting out bleeding-edge updates to Apple’s X11 called XQuartz that fixed a lot of the programs and I have kept using it ever since.

Two years ago, I wrote a blog entry with hints for setting up X11 for the astronomer. The problem is that while the hints in that writeup are still valid, they don’t work if you are using Xquartz because the preferences are stored in a different location for XQuartz versus the built-in X11. As such, I am reproducing those X11 hints here, but with the edits necessary for use with XQuartz.

Once you have installed XQuartz, the X11.app should automatically launch when a program that needs X11 is executed (If you are an old hand at X11, you probably discovered since moving to Leopard that you should NOT set the DISPLAY variable to :0 to display an Xwindow on your primary display, just leave DISPLAY undefined.):

  1. There are many hidden preferences in XQuartz just like in many Mac Applications. You can see a list of the hidden (and not hidden) preferences using the command line tool defaults. To see the available XQuartz preferences, type:defaults read org.X.x11NOTE: If you are still using Apple’s built-in X11 implementation (or if you are using MacOS 10.4), just replace ‘org.x.X11’ with ‘com.apple.x11’ in all the following hints.
  2. In addition to “reading” the preferences, you can write to them. From the command line you can type:
    • defaults write org.X.x11 no_quit_alert true
      This allows X11 to quit without an alert box. Useful if you find it irritating like I do that X11 will prevent me from logging out or the computer from restarting due to that dialog box. However, this does mean you can accidentally quit X11.app pretty easily if you hit cmd-Q at the wrong time.
    • defaults write org.X.x11 wm_ffm true
      Allows which X11 window is selected to follow the mouse, which is the way X11 behaves under most *nix systems by default.
    • defaults write org.X.x11 wm_click_through -bool true
      This activates click_thorough events in the Quartz window manager, which allows clicks to pinned windows, another behavior common to *nix X11 installations.
  3. You can control which window manager is launched (if you prefer something other than the quartz-wm used by default). If you don’t have a ~/.xinitrc file, copy the default one:
    cp /private/etc/X11/xinit/xinitrc ~/.xinitc

    and then manipulate it with any text editor.
  4. BIG LAPTOP USER HINT: Because XQuartz on the Macintosh uses authentication to prevent connections from unauthorized sources to the X11 client, something interesting happens when you change IP address, you will discover you can’t use X11.app from the MacOS X Terminal until you quite and relaunch X11.app. This happens to me all the time on my laptop when I travel and the IP address changes. I recommend either using the Xterm as your terminal or just get used to restarting X11 if you have problems connecting to the terminal.
  5. You can run X11 remotely on your Mac, if you can ssh into your Mac, then just use
    ssh -Y youraccount@yourcomputer.com

    , the -Y flag should allow you to run X11 remotely as long as X11.app is running on your machine before the connection is made. If your ssh on the remote machine doesn’t support X11 connections and you have admin access, you can edit the file /etc/sshd_config on the remote machine and make sure X11 Forwarding is turned on by looking for the following lines and making sure they are uncommented and that all “no”’s are set to “yes”:
    X11Forwarding yes
    X11DisplayOffset 10
    X11UseLocalhost yes

And that is it for the hints for now.

Leave a Reply


  • Translate

  • Astro Pic o' the Day

  • Archives

  • Admin



↑ Top