Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I occasionally run into the following first-world nightmare, usually when trying to run open source software (in this case Inkscape on a Mac Pro running Lion, though I've seen this error before as well, I think with Wine and OpenOffice if I remember right):


  • First, it fails to open with this error:

The application X11 could not be opened.

An error occurred while starting the X11 server: "Cannot establish any listening sockets - Make sure an X server isn't already running"

Click Quit to quit X11. Click Report to see more details or send a report to Apple.

[Report...] [Quit]

  • Clicking 'Quit' just causes the exact same error to endlessly pop up again. Force Quitting the application that caused the error (Inkscape) or X11 itself has the same result. As does quitting from the dock.
  • If I try to just ignore it, it refreshes itself after a few minutes or so, and the icon keeps bouncing in the dock.
  • Attempting to restart to break the cycle fails with this sadistic error:

The application X11 canceled restart.

To try again, quit X11 and choose Restart from the Apple menu.

But the reason I want to restart is to make X11 quit and stop it from reopening itself!

Report... causes X11 to crash with an "X11 quit unexpectedly" error - but it still automatically re-opens itself and it still cancels shutdown / restart in exactly the same way. Shut down has the same error as restart: "The application X11 canceled shut down".


Any ideas how to:

  • Get X11 to go away so I can restart and continue what I was doing? (without just pulling the plug)
  • (for bonus points) Stop things like this from happening? There's no clues an average user like me can make sense of in any of the above for how to debug and fix the underlying problem.
share|improve this question
add comment

4 Answers

You can force X11 to quit, which will allow for a normal reboot but won't fix whatever problems are causing X11 to fail to launch / hang / otherwise misbehave.

Open terminal and type:

 killall X11

You might use sudo to kill any X1 processes that you don't own, but use care with root and killing processes.

share|improve this answer
add comment

For the reboot:

Save your work then open a terminal and type:

sudo reboot

Bam! No questions asked; no "cancelled" message, goes down hard!

No ideas on the second question other than reboot and retry repeatedly, seems to fail about 9/10 times for me.

share|improve this answer
add comment

Remove all the .plist files with X11 in them in the Preferences folder (2 in my case) and then quit the X11 app.

From: https://discussions.apple.com/message/24658060#24658060

tomahawk.chop on Mar 9, 2013 2:16 PM in response to chltjdtn

Re: My x11 is malfunctioning.

Had this same problem. XQuartz would not start working after a complete reinstall of X11, or reboot, repair permissions etc. Ended up realizing it was a User specific problem, so I removed the X11 .plist files from ~/Users/yourusername/Library/Preferences. I don't remember the exact names of the two .plist files I removed, but they were org.x11.pllist or something along those lines. Once I removed these two files and rebooted XQuartz the skies parted and X11 worked. Hope this helps!

share|improve this answer
add comment

This is not a complete answer, but might help someone...

I managed to get it to let me restart by, essentially, making it crash as hard as possible so X11's restart took longer, and very quickly restarting in the time before it had loaded up... ugly but it worked:

  • Go through all the steps under 'Report...' down to and including sending an error report. X11 crashed in a variety of exotic ways during this process.
  • X11 then began to restart in a way that tried to open previous windows, and the 'open previous windows' process itself was crashing.
  • This meant that rather than rebooting and crashing instantly, it took a few seconds to reboot and crash - allowing just enough time to restart before X11 began cancelling restart again.

Still no idea about underlying causes.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.