X11.app(在 SnowLeopard 上)不会启动

Lau*_*ves 3 xorg macports osx-snow-leopard

今天我发现 X11.app 不再适用于我的 Mac。我不确定这是什么时候发生的。我想距离我上次使用 X11 应用程序已经有几个星期了。

“不再有效”我的意思是它完全没有任何作用。如果我尝试直接运行 X11.app,则 Dock 中不会出现任何内容,也没有错误消息 - 就好像我根本没有运行它一样。

如果我尝试从终端运行 X 应用程序(例如:xterm),它就会永远挂起。我假设它正在等待 X11 启动。

我尝试从 Snow Leopard 安装 DVD 重新安装 X11,但似乎没有任何效果。

更新

我安装了 MacPorts,看起来xorg-server可能已经安装了。我试过卸载它...

port -u uninstall xorg xorg-server
Run Code Online (Sandbox Code Playgroud)

...并重新安装它...

port install xorg xorg-server
Run Code Online (Sandbox Code Playgroud)

...但无论哪种方式都行不通。

/var/log/system.log是安装 MacPorts xorg 时显示的内容。

Dec  1 14:28:26 Stripy org.macports.X11.stub[51551]: Xquartz: bootstrap_look_up(): Unknown service name
Dec  1 14:28:27 Stripy org.macports.startx[51470]: waiting for X server to begin accepting connections 
Dec  1 14:28:27 Stripy org.macports.startx[51470]: xinit: giving up
Dec  1 14:28:27 Stripy org.macports.startx[51470]: xinit: unable to connect to X server: Operation timed out
Dec  1 14:28:27 Stripy org.macports.startx[51470]: waiting for X server to begin accepting connections xinit: server error
Dec  1 14:28:27 Stripy org.macports.startx[51470]: waiting for X server to begin accepting connections 
Dec  1 14:28:27 Stripy defaults[51670]: \nThe domain/default pair of (org.macports.X11, dpi) does not exist
Dec  1 14:28:27 Stripy org.macports.startx[51638]: xauth:  file /Users/laurence/.serverauth.51639 does not exist
Dec  1 14:28:28 Stripy org.macports.startx[51638]: 
Dec  1 14:28:28 Stripy org.macports.X11.stub[51723]: Xquartz: Unable to locate waiting server: org.macports.X11
Dec  1 14:28:28 Stripy org.macports.X11.stub[51727]: Xquartz: Starting X server: /Applications/MacPorts/X11.app/Contents/MacOS/X11 --listenonly
Dec  1 14:28:30 Stripy org.macports.startx[51638]: ^M
Dec  1 14:28:32 Stripy org.macports.startx[51638]: waiting for X server to begin accepting connections 
Dec  1 14:28:48: --- last message repeated 8 times ---
Run Code Online (Sandbox Code Playgroud)

这一遍又一遍地重复,(模时间戳和 pid)。

这是未安装 MacPorts xorg 时的样子。

Dec  1 14:55:32 Stripy defaults[64771]: \nThe domain/default pair of (org.macports.X11, dpi) does not exist
Dec  1 14:55:32 Stripy org.macports.startx[64737]: xauth:  file /Users/laurence/.serverauth.64738 does not exist
Dec  1 14:55:32 Stripy org.macports.startx[64737]:·
Dec  1 14:55:32 Stripy org.macports.startx[64737]: xinit: unable to run server "/opt/local/bin/X": No such file or directory
Dec  1 14:55:32 Stripy org.macports.startx[64737]: Use the -- option, or make sure that /opt/local/bin is in your path and
Dec  1 14:55:32 Stripy org.macports.startx[64737]: that "/opt/local/bin/X" is a program or a link to the right type of server
Dec  1 14:55:32 Stripy org.macports.startx[64737]: for your display.  Possible server names include:
Dec  1 14:55:32 Stripy org.macports.startx[64737]:·
Dec  1 14:55:32 Stripy org.macports.startx[64737]:     Xquartz     Mac OSX Quartz displays.
Dec  1 14:55:32 Stripy org.macports.startx[64737]:     Xvfb        Virtual frame buffer
Dec  1 14:55:32 Stripy org.macports.startx[64737]:     Xfake       kdrive-based virtual frame buffer
Dec  1 14:55:32 Stripy org.macports.startx[64737]:     Xnest       X server nested in a window on another X server
Dec  1 14:55:32 Stripy org.macports.startx[64737]:     Xephyr      kdrive-based nested X server
Dec  1 14:55:32 Stripy org.macports.startx[64737]:     Xvnc        X server accessed over VNC's RFB protocol
Dec  1 14:55:32 Stripy org.macports.startx[64737]:     Xdmx        Distributed Multi-head X server
Dec  1 14:55:32 Stripy org.macports.startx[64737]:·
Dec  1 14:55:34 Stripy org.macports.startx[64737]:  xinit: giving up
Dec  1 14:55:34 Stripy org.macports.startx[64737]: xinit: unable to connect to X server: Connection refused
Dec  1 14:55:34 Stripy org.macports.startx[64737]: xinit: server error
Dec  1 14:55:34: --- last message repeated 1 time ---
Run Code Online (Sandbox Code Playgroud)

同样,这一遍又一遍地重复。

我还尝试卸载 macports xorg,然后安装 XQuartz(再次重新启动以确保)。运行应用程序/实用程序/XQuartz 不起作用,尝试xterm从终端运行也不起作用 ,这是该/var/log/system.log设置的输出:

Dec  1 16:13:01 Stripy org.macosforge.xquartz.startx[343]: waiting for X server to begin accepting connections 
Dec  1 16:13:01 Stripy org.macosforge.xquartz.X11.stub[400]: Xquartz: bootstrap_look_up(): Unknown service name
Dec  1 16:13:02 Stripy org.macosforge.xquartz.startx[343]: waiting for X server to begin accepting connections 
Dec  1 16:13:02 Stripy org.macosforge.xquartz.startx[343]: /opt/X11/bin/xinit: giving up
Dec  1 16:13:02 Stripy org.macosforge.xquartz.startx[343]: /opt/X11/bin/xinit: unable to connect to X server: Operation timed out
Dec  1 16:13:02 Stripy org.macosforge.xquartz.startx[343]: waiting for X server to begin accepting connections /opt/X11/bin/xinit: server error
Dec  1 16:13:02 Stripy org.macosforge.xquartz.startx[343]: waiting for X server to begin accepting connections 
Dec  1 16:13:02 Stripy defaults[544]: \nThe domain/default pair of (org.macosforge.xquartz.X11, dpi) does not exist
Dec  1 16:13:02 Stripy org.macosforge.xquartz.startx[510]: xauth:  file /Users/laurence/.serverauth.511 does not exist
Dec  1 16:13:02 Stripy org.macosforge.xquartz.startx[510]: 
Dec  1 16:13:02 Stripy org.macosforge.xquartz.X11.stub[588]: Xquartz: Unable to locate waiting server: org.macosforge.xquartz.X11
Dec  1 16:13:02 Stripy org.macosforge.xquartz.X11.stub[589]: Xquartz: Starting X server: /Applications/Utilities/XQuartz.app/Contents/MacOS/X11 --listenonly
Dec  1 16:13:03 Stripy login[619]: USER_PROCESS: 619 ttys000
Dec  1 16:13:04 Stripy org.macosforge.xquartz.startx[510]: ^M
Dec  1 16:13:06 Stripy org.macosforge.xquartz.startx[510]: waiting for X server to begin accepting connections 
Dec  1 16:13:22: --- last message repeated 8 times ---
Run Code Online (Sandbox Code Playgroud)

(再一次,重复。)

我尝试搜索其中一些消息,并找到了一些成功但没有具体的解决方案。

gee*_*aur 7

OS X 上的 X11 需要一对launchd plist文件才能激活;这对必须匹配,并且必须在login时间正确配置。每个 X11 服务器都提供自己的一对:

  • 适用于 Apple 的 X11,/System/Library/LaunchDaemons/org.x.privileged_startx.plist以及/System/Library/LaunchAgents/org.x.startx.plist
  • 对于 MacOSForge XQuartz,/Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist/Library/LaunchAgents/org.macosforge.xquartz.startx.plist
  • 用于 MacPorts XQuartz/Library/LaunchDaemons/org.macports.privileged_startx.plist/Library/LaunchAgents/org.macports.startx.plist.

当存在多个 X11 安装时,它们很容易混淆。最好的办法是用 禁用所有 startx LaunchAgents launchctl unload -w,然后只启用你想使用的launchctl load -w那个(-w告诉launchctl记住后续启动/登录的操作)。不要卸载 LaunchDaemons。为了正确设置 DISPLAY 环境变量,有必要在此之后注销并重新登录。