Apple's X11-Users List FAQ

Don't like launchd?

Run the following to prevent launchd from setting $DISPLAY and creating its socket.

( launchctl unload -w /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
(Apple's launchctl unload -w /System/Library/LaunchAgents/org.x.startx.plist
(MacPorts' launchctl unload -w /Library/LaunchAgents/org.macports.startx.plist

Want Tiger's X11? (Leopard Only, Unsupported)

I'm still trying to work out a more official solution to this, but while you're waiting:

  1. Download X11 Update 2006 from
  1. In Terminal:
sudo launchctl unload -w /System/Library/LaunchAgents/org.x.X11.plist
sudo mv /Applications/Utilities/ /Applications/Utilities/
sudo rm /usr/X11R6
sudo ditto -Vx --noqtn /Volumes/X11\ Update\ 2006/X11Update2006.pkg/Contents/Archive.pax.gz /
log out, then back in to clear $DISPLAY

You will then have both versions installed. To run the Tiger version of X11, just run /Applications/Utilities/ To run the Leopard version, run /usr/X11/ When I tried this, I got the "double X11 icon in Dock" thing -- I have to talk to the Dock guys about that.

Note that this will not install the Tiger X11SDK.pkg, but that's okay -- you can build programs against the files in /usr/X11 and still run them with the Tiger

  1. To reverse the above directions:
    sudo rm -rf /etc/X11 /usr/X11R6 /Applications/Utilities/
    sudo ln -s X11 /usr/X11R6
    sudo mv /Applications/Utilities/ /Applications/Utilities/
    sudo launchctl load -w /System/Library/LaunchAgents/org.x.X11.plist
    log out, then back in to set $DISPLAY

ssh X forwarding debugging

Mountain Lion Users, please note that there is a known issue sshing into a ML server. To get X11 forwarding working, please add the following to /etc/sshd_config:

XauthLocation /opt/X11/bin/xauth

Try these SSH troubleshooting steps. This list shows the expected behavior of the system.

local $ — refers to commands run on your local Mac running Leopard

remote $ — refers to commands run on a remote Unix machine, of any type

[1] local $ echo $DISPLAY
[2] local $ grep DISPLAY ~/.*rc ~/.login ~/.*profile ~/.MacOSX/environment.plist 2>/dev/null
[3] local $ grep -r DISPLAY /opt/local/etc /sw/etc /etc 2>/dev/null
[4] local $ ssh -Y remote
Warning: No xauth data; using fake authentication data for X11 forwarding.
[5] remote $ echo $DISPLAY
[6] remote $ grep X11 /etc/ssh/sshd_config ~/.ssh/*
X11Forwarding yes
X11DisplayOffset 10


If step 1 returns :0, localhost:0 or anything similar, you have a configuration file that is overriding launchd's $DISPLAY.

If step 2 outputs anything, it indicates that a configuration file in your home directory may be the culprit; try creating a new user and repeating the steps with that user.

If step 3 outputs anything, it indicates that a system-wide change was made that is overriding your environment. If it begins with /opt/local, it is MacPorts; if it begins with /sw, it is Fink. Otherwise, it is probably a commercial program that uses X11; contact your vendor for an updated version.

The warning message in step 4 is harmless.

If step 5 does not output anything, then step 6's results probably include X11Forwarding no. In this case, you must fix the configuration on the remote side.

If step 5 outputs anything other than localhost:xx.0, then your remote configuration is overriding the DISPLAY environment variable set by sshd on the remote side.

Suppressing xterm launching by default

In Leopard, xterm is run directly by which causes the server to start. Think of as something that *just* executes xterm. If you want to change this from xterm to something else, you can change the application run by doiing the following:

( defaults write org.macosforge.xquartz.X11 app_to_run <whatever you want to run>
(Apple's defaults write org.x.X11 app_to_run <whatever you want to run>
(MacPorts' defaults write org.macports.X11 app_to_run <whatever you want to run>

So if you want nothing to run, you can accomplish this by:

defaults write org.macosforge.xquartz.X11 app_to_run /usr/bin/true

If you launch from the dock or run "open -a XQuartz" it will run app_to_run.

Note: For versions prior to the X11-2.1.1 package, use the following instead:

defaults write org.x.X11_launcher app_to_run /usr/X11/bin/xdpyinfo

Messed it up, got confused, want to start over? (Leopard)

Before you start deleting anything, make sure you have a Leopard's installation DVD available and downloaded the latest update of X11 from this site.

  • Delete pretty much all X11 from you system, and let it forget its receipts
    sudo rm -rf /usr/X11* /System/Library/Launch*/org.x.* /Applications/Utilities/ /etc/*paths.d/X11
    sudo pkgutil --forget
    sudo pkgutil --forget
    sudo pkgutil --forget
    sudo pkgutil --forget org.x.X11.pkg
  • If you want Apple's X11
    • Install X11User.pkg from Leopard's installation DVD, which is in /Volumes/Mac OS X Install DVD/Optional Install/Optional Installs.mpkg
    • Install X11SDK.pkg from Leopard's installation DVD, which is in /Volumes/Mac OS X Install DVD/Optional Installs/Xcode Tools/Packages/
    • Install the latest OSX Combo Update (make sure you get the "Combo Update" and not the "Update")
  • If you want the latest release

Uninstall (Snow Leopard or Later)

XQuartz does not replace the system X11 on Snow Leopard, so you can go back to the Apple-provided rather easily. Just launch rather than to get the older server. If you want to make Apple's the default server (owning the launchd $DISPLAY socket), then you should disable the org.macosforge.xquartz.startx.plist as described in the first question. After logging out and back in, Apple's will be default. If you still want to remove from your system, you can do that with these two steps:

launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/ /etc/*paths.d/*XQuartz
sudo pkgutil --forget org.macosforge.xquartz.pkg

Please file a bug report to let us know why you reverted to the system, so we can address the problem in a future release.

How can my launched applications inherit my tcsh environment? (Old)

By default, X11-2.3.2 inherits your bash environment. 2.3.3 and later should inherit your login shell's environment. We do this by starting from a login shell using the script below. This should work for the most common (and some less common) shells.

$ cat /Applications/Utilities/

set "$(dirname "$0")"/X11.bin "${@}"

if [ -x ~/.x11run ]; then
	exec ~/.x11run "${@}"

case $(basename "${SHELL}") in
	bash)          exec -l "${SHELL}" --login -c 'exec "${@}"' - "${@}" ;;
	ksh|sh|zsh)    exec -l "${SHELL}" -c 'exec "${@}"' - "${@}" ;;
	csh|tcsh)      exec -l "${SHELL}" -c 'exec $argv:q' "${@}" ;;
	es|rc)         exec -l "${SHELL}" -l -c 'exec $*' "${@}" ;;
	*)             exec    "${@}" ;;

If this script does not satisfy your login shell, please let us know on the xquartz-dev mailing list. You can also create a ~/.x11run script to handle your unique shell.

Will XQuartz be released for Tiger?

XQuartz is available for Tiger via MacPorts. After installing MacPorts, run this command:

sudo port -v install xorg-server

This will create /Applications/MacPorts/

Default resolution too low? Fonts too small?

Do your fonts come out too small in programs like Gimp? This and related problems are especially noticeable on the MacBook Pro with high-definition screen. The problem is that older versions of X11 use a resolution setting of 75dpi (dots per inch), and even newer ones use 96dpi by default. Since X11 2.3.2rc4, you can override this default and put in a value that suits your display. For example, for the MacBook Pro, the appropriate value is 133dpi. To do this, enter the following in the Terminal, and restart X11:

defaults write org.macosforge.xquartz.X11 dpi -int 133

You should replace 133 by some other number appropriate to your display if it is not 133dpi. How do you tell what the appropriate dpi setting is? One way (there may be simpler ones!) is to fire up Acrobat or Acrobat Reader, and look at Preferences -> Page Display, which will tell you what the System Setting for your resolution is in dpi.

Want another server?

If you want to run multiple servers, you can do that by just copying the bundle to another name (like and editing the Info.plist to change the CFBundleIdentifier to a different value (like org.x.X11.256color). This will let you launch a different X11 server with different options. The launchd DISPLAY socket will always correspond to the original Do not change the CFBundleIdentifier of the original or you will run into problems. Your xinitrc inherits the CFBundleIdentifier as the X11_PREFS_DOMAIN environment variable, so you can use this in your xinitrc to start up differently.

Example: A dedicated server for The Gimp:

1) Copy to

2) edit and change the CFBundleIdentifier from "org.x.X11" to "org.x.X11.gimp"

3) Create a xinitrc.d script to handle starting gimp:

$ cat > /usr/X11/lib/X11/xinit/xinitrc.d/ << EOF
if [ "$X11_PREFS_DOMAIN" = "org.x.X11.gimp" ] ; then
       quartz-wm &
       exec gimp

4) Make that script executable:

$ sudo chmod 755 /usr/X11/lib/X11/xinit/xinitrc.d/

Note: If you are a standard user and don't have administrative privileges, you can put in ~/Applications and use ~/.xinitrc.d/ instead.

Last modified 3 years ago Last modified on Oct 24, 2012 9:07:27 AM