XQuartz 2.7.11 fails to launch on Mac Sierra 10.12.6

user9179484 picture user9179484 · Jan 5, 2018 · Viewed 8.8k times · Source

XQuartz stopped working after having worked fine for a long time. I checked some obvious things like my $PATH to see if something stepped on it but didn't find any discernible difference from what I had previously.

$ echo $PATH /usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/usr/X11/bin:/usr/local/opt/python/libexec/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin

So, after looking at what seems like a million suggestions I uninstalled with the commands listed at: https://gist.github.com/pwnsdx/d127873e24cef159d4d603accaf37ee4

After reinstalling with XQuartz-2.7.11.dmg I try launching XQuartz.app by right clicking it in a finder window but it doesn't launch. The only indication of a problem I can see is when launching the XQuartz.app I get the following:

$ tail -f /private/var/log/system.log | grep xquartz Jan 5 17:26:33 bos-mpx3u com.apple.xpc.launchd[1] >(org.macosforge.xquartz.X11.24980[2612]): Service exited with abnormal code: 126

So, I've tried uninstalling and reinstalling XQuartz-2.7.9.dmg, reinstalling XQuartz-2.7.11.dmg and even reinstalling via $ brew cask install xquartz but I always get the same results.

At this point I've burned way to much time trying to track this down. Any help is truely appreciated.

Answer

Jimmy MG Lim picture Jimmy MG Lim · Jan 26, 2018

It often hard to nail the issue with limited info. but few checkpoints as it works fine.

  • ensure your Sierra is > 10.13.x
  • reinstall xquartz cask via : brew cask reinstall xquartz
  • if needed use brew cask reinstall xquartz --force

this should give you 2.7.11

ensure that your xquartz is symlinked correctly. it should be in your apps folder. refer to this:

brew linkapps for homebrew casks (automatically create symlink to /Applications folder)

hope that helps. I tested and works fine.

other things to check include

  • in your terminal shell (bash), find the executable bin of xquartz
$ which xquartz
  • if it does/might not exist but it should be in /opt/X11/bin/xquartz
  • now either (1) ensure that /opt/X11/bin/ is in your path by export PATH="/opt/X11/bin:$PATH" or (2) create a symlink for xquartz from /usr/local/bin/xquartz to /opt/X11/bin/xquartz .

this will link up your xquartz correctly or at least its in your accessible binary. Some applications will read only environment variables that determines where xquartz so check the documentation of the apps and what they expect in terms of environment variables. If you are curious, just type env or printenv in your shell to spit out your env vars for current session.