Xvncが起動できなくなった(´・ω・`)

家鯖をFreeBSD 9.2-RELEASEから10.1-RELEASEに更新したら、Xvncが起動しなくなってしまった。X Window System単体でも下記のような感じで動かない。

(上略)
Initializing built-in extension DRI2
Loading extension GLX
(EE) 
Fatal server error:
(EE) no screens found(EE) 
(EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
(EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
(EE) 
(EE) Server terminated with error (1). Closing log file.

xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error

とりあえず再設定してみる(本当は/var/log/Xorg.0.logを見るべき。)

$ sudo Xorg -configure
X.Org X Server 1.14.7
Release Date: 2014-06-05
X Protocol Version 11, Revision 0
Build Operating System: FreeBSD 10.1-RELEASE-p6 amd64 
Current Operating System: FreeBSD Freyja.local.decomo.info 10.1-RELEASE-p6 FreeBSD 10.1-RELEASE-p6 #0: Tue Feb 24 19:00:21 UTC 2015     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
Build Date: 04 April 2015  11:50:25PM
 
Current version of pixman: 0.32.6
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sun Apr  5 13:37:46 2015
List of video drivers:
	vboxvideo
	vmware
	vmwlegacy
	vesa
(EE) module ABI major version (6) doesn't match the server's version (14)
(++) Using config file: "/root/xorg.conf.new"
(==) Using system config directory "/usr/local/share/X11/xorg.conf.d"


Xorg detected your mouse at device /dev/sysmouse.
Please check your config if the mouse is still not
operational, as by default Xorg tries to autodetect
the protocol.

Your xorg.conf file is /root/xorg.conf.new

To test the server, run 'X -config /root/xorg.conf.new'

(EE) Server terminated with error (2). Closing log file.

なんぞモジュールのABIが適合してないらしい。ここでようやく/var/log/Xorg.0.logを見るべきことに気づく。

(上略)
[   912.200] (II) LoadModule: "vmware"
[   912.201] (II) Loading /usr/local/lib/xorg/modules/drivers/vmware_drv.so
[   912.201] (II) Module vmware: vendor="X.Org Foundation"
[   912.202] 	compiled for 1.7.7, module version = 11.0.99
[   912.202] 	Module class: X.Org Video Driver
[   912.202] 	ABI class: X.Org Video Driver, version 6.0
[   912.202] (EE) module ABI major version (6) doesn't match the server's version (14)
[   912.202] (II) UnloadModule: "vmware"
[   912.202] (II) Unloading vmware
[   912.203] (EE) Failed to load module "vmware" (module requirement mismatch, 0)
[   912.203] (II) LoadModule: "vmwlegacy"
[   912.204] (II) Loading /usr/local/lib/xorg/modules/drivers/vmwlegacy_drv.so
[   912.205] (EE) Failed to load /usr/local/lib/xorg/modules/drivers/vmwlegacy_drv.so: /usr/local/lib/xorg/modules/drivers/vmwlegacy_drv.so: Undefined symbol "miEmptyData"
[   912.205] (II) UnloadModule: "vmwlegacy"
[   912.205] (II) Unloading vmwlegacy
[   912.205] (EE) Failed to load module "vmwlegacy" (loader failed, 7)
(下略)

vmwareのビデオドライバが不味いっぽい。昔ESXi上で動かしていた時の残骸で、またfreebsd-updateの時に共有ライブラリの更新をミスったのが根本原因だろう。OS更新に失敗して見事にpkg情報が全部飛んでしまっているので、一度pkgでインストールしすぐにアンインストール。vmwlegacy_drv.soはなぜか消えなかったので手動で削除。

sudo pkg install xf86-video-vmware
sudo pkg remove xf86-video-vmware
sudo rm /usr/local/lib/xorg/modules/drivers/vmwlegacy_drv.so

Xorg単体では動くようになったっぽいが(ヘッドレス環境なので本当に動いてるかは未確認)、やっぱりXvncが起動しない。ログはこんな感じ。

Xvnc Free Edition 4.1.3 - built Mar 29 2015 07:02:28
Copyright (C) 2002-2008 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
Underlying X server release 40300000, The XFree86 Project, Inc


Mon Apr  6 23:15:00 2015
 vncext:      VNC extension running!
 vncext:      Listening for VNC connections on port 5901
 vncext:      Listening for HTTP connections on port 5801
 vncext:      created VNC server for screen 0
error opening security policy file /usr/local/lib/X11/xserver/SecurityPolicy
Could not init font path element /usr/local/lib/X11/fonts/misc/, removing from list!
Could not init font path element /usr/local/lib/X11/fonts/Speedo/, removing from list!
Could not init font path element /usr/local/lib/X11/fonts/Type1/, removing from list!
Could not init font path element /usr/local/lib/X11/fonts/CID/, removing from list!
Could not init font path element /usr/local/lib/X11/fonts/75dpi/, removing from list!
Could not init font path element /usr/local/lib/X11/fonts/100dpi/, removing from list!

Fatal server error:
could not open default font 'fixed'
xsetroot:  unable to open display 'Freyja.local.decomo.info:1'
vncconfig: unable to open display "Freyja.local.decomo.info:1"
xterm: Xt error: Can't open display: Freyja.local.decomo.info:1
Openbox-Message: 環境変数 DISPLAY からディスプレイを開くのに失敗しました。

フォントパスが無いと怒られてるけど、これらパスはxorg.confから取り除いてるんだけどな…。

使えなくても直ぐさま困る訳ではないが、使えると便利な場合があるので早いとこ何とかしたい(´・ω・`)

2015-4-30追記

結局、インストール済みのpkgを全部消し、更に/var/db/pkg/var/db/portsを真っさらにしてTigerVNC環境を一から構築し直したら何事も無く動くようになった(´・ω・`)