自 20.04 以来,我的无头 xubuntu / xfce 服务器会在短时间后(例如 5 分钟左右)冻结 vnc 服务器,尤其是在未激活时。从 vncserver 启动时,系统日志显示
Oct 11 22:35:02 BS-Server2 systemd[1]: Started Run anacron jobs.
Oct 11 22:35:02 BS-Server2 anacron[93014]: Anacron 2.3 started on 2020-10-11
Oct 11 22:35:02 BS-Server2 anacron[93014]: Normal exit (0 jobs run)
Oct 11 22:35:02 BS-Server2 systemd[1]: anacron.service: Succeeded.
Oct 11 22:36:18 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] AppArmor D-Bus mediation is enabled
Oct 11 22:36:18 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Activating service name='org.a11y.Bus' requested by ':1.0' (uid=1000 pid=93089 comm="xf
ce4-session " label="unconfined")
Oct 11 22:36:18 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Successfully activated service 'org.a11y.Bus'
Oct 11 22:36:18 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Activating service name='org.xfce.Xfconf' requested by ':1.2' (uid=1000 pid=93089 comm=
"xfce4-session " label="unconfined")
Oct 11 22:36:18 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Successfully activated service 'org.xfce.Xfconf'
Oct 11 22:36:18 BS-Server2 org.a11y.Bus[93110]: dbus-daemon[93110]: Activating service name='org.a11y.atspi.Registry' requested by ':1.0' (uid=1000 pid=93089 comm=
"xfce4-session " label="unconfined")
Oct 11 22:36:18 BS-Server2 org.a11y.Bus[93110]: dbus-daemon[93110]: Successfully activated service 'org.a11y.atspi.Registry'
Oct 11 22:36:18 BS-Server2 org.a11y.Bus[93120]: SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry
Oct 11 22:36:18 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Activating service name='org.xfce.ScreenSaver' requested by ':1.2' (uid=1000 pid=93089
comm="xfce4-session " label="unconfined")
Oct 11 22:36:18 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Activating service name='org.gtk.vfs.Daemon' requested by ':1.5' (uid=1000 pid=93124 co
mm="/usr/bin/xfce4-screensaver --no-daemon " label="unconfined")
Oct 11 22:36:18 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Successfully activated service 'org.gtk.vfs.Daemon'
Oct 11 22:36:18 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Successfully activated service 'org.xfce.ScreenSaver'
Oct 11 22:36:20 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Activating service name='org.freedesktop.thumbnails.Thumbnailer1' requested by ':1.15'
(uid=1000 pid=93168 comm="xfdesktop --display :1.0 --sm-client-id 2f8228d1d-" label="unconfined")
Oct 11 22:36:20 BS-Server2 org.freedesktop.thumbnails.Thumbnailer1[93201]: error: XDG_RUNTIME_DIR not set in the environment.
Oct 11 22:36:20 BS-Server2 kernel: [115733.127180] xiccd[93203]: segfault at e4 ip 00005602078484f6 sp 00007ffdf326ff50 error 4 in xiccd[560207844000+5000]
Oct 11 22:36:20 BS-Server2 kernel: [115733.127196] Code: 00 eb 91 90 48 89 ef e8 e8 f8 ff ff eb c5 e8 01 cc ff ff 90 f3 0f 1e fa 55 53 48 89 fb 48 83 ec 08 e8 ce f
8 ff ff 48 8b 7b 08 <8b> 97 e4 00 00 00 85 d2 7e 34 31 ed 66 0f 1f 44 00 00 48 89 e8 ba
Oct 11 22:36:20 BS-Server2 kernel: [115733.257146] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
Oct 11 22:36:20 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Activating service name='org.freedesktop.Notifications' requested by ':1.21' (uid=1000
pid=93208 comm="xfce4-power-manager " label="unconfined")
Oct 11 22:36:20 BS-Server2 kernel: [115733.304595] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
Oct 11 22:36:20 BS-Server2 kernel: [115733.317064] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
Oct 11 22:36:20 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Successfully activated service 'org.freedesktop.Notifications'
Oct 11 22:36:20 BS-Server2 NetworkManager[812]: <info> [1602448580.7144] agent-manager: agent[12c3d6c8e884b7fb,:1.130/org.freedesktop.nm-applet/1000]: agent regis
tered
Oct 11 22:36:21 BS-Server2 org.freedesktop.thumbnails.Thumbnailer1[93180]: Registered thumbnailer /usr/bin/gdk-pixbuf-thumbnailer -s %s %u %o
Oct 11 22:36:21 BS-Server2 org.freedesktop.thumbnails.Thumbnailer1[93180]: Registered thumbnailer atril-thumbnailer -s %s %u %o
Oct 11 22:36:21 BS-Server2 org.freedesktop.thumbnails.Thumbnailer1[93180]: Registered thumbnailer /usr/bin/gdk-pixbuf-thumbnailer -s %s %u %o
Oct 11 22:36:21 BS-Server2 org.freedesktop.thumbnails.Thumbnailer1[93180]: Registered thumbnailer gnome-thumbnail-font --size %s %u %o
Oct 11 22:36:21 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Activating service name='org.gtk.vfs.UDisks2VolumeMonitor' requested by ':1.18' (uid=10
00 pid=93180 comm="/usr/lib/x86_64-linux-gnu/tumbler-1/tumblerd " label="unconfined")
Oct 11 22:36:21 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Successfully activated service 'org.gtk.vfs.UDisks2VolumeMonitor'
Oct 11 22:36:21 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Activating service name='org.gtk.vfs.AfcVolumeMonitor' requested by ':1.18' (uid=1000 p
id=93180 comm="/usr/lib/x86_64-linux-gnu/tumbler-1/tumblerd " label="unconfined")
Oct 11 22:36:21 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Successfully activated service 'org.gtk.vfs.AfcVolumeMonitor'
Oct 11 22:36:21 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Activating service name='org.gtk.vfs.GoaVolumeMonitor' requested by ':1.18' (uid=1000 p
id=93180 comm="/usr/lib/x86_64-linux-gnu/tumbler-1/tumblerd " label="unconfined")
Oct 11 22:36:21 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Successfully activated service 'org.gtk.vfs.GoaVolumeMonitor'
Oct 11 22:36:21 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Activating service name='org.gtk.vfs.GPhoto2VolumeMonitor' requested by ':1.18' (uid=10
00 pid=93180 comm="/usr/lib/x86_64-linux-gnu/tumbler-1/tumblerd " label="unconfined")
Oct 11 22:36:21 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Successfully activated service 'org.gtk.vfs.GPhoto2VolumeMonitor'
Oct 11 22:36:21 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Activating service name='org.gtk.vfs.MTPVolumeMonitor' requested by ':1.18' (uid=1000 p
id=93180 comm="/usr/lib/x86_64-linux-gnu/tumbler-1/tumblerd " label="unconfined")
Oct 11 22:36:21 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Successfully activated service 'org.gtk.vfs.MTPVolumeMonitor'
Oct 11 22:36:21 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Successfully activated service 'org.freedesktop.thumbnails.Thumbnailer1'
Oct 11 22:36:21 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Activating service name='org.gtk.vfs.Metadata' requested by ':1.15' (uid=1000 pid=93168
comm="xfdesktop --display :1.0 --sm-client-id 2f8228d1d-" label="unconfined")
Oct 11 22:36:21 BS-Server2 dbus-daemon[93103]: [session uid=1000 pid=93101] Successfully activated service 'org.gtk.vfs.Metadata'
Oct 11 22:36:25 BS-Server2 kernel: [115738.266473] panel-6-systray[93172]: segfault at f8 ip 00007f5b3f656b66 sp 00007ffdcdb33948 error 4 in libgdk-3.so.0.2404.16[
7f5b3f633000+81000]
Oct 11 22:36:25 BS-Server2 kernel: [115738.266503] Code: 25 fe ff e9 57 fd ff ff 66 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 8b 87 f8 00 00 00 c3 0f 1f 40 0
0 f3 0f 1e fa 31 c0 <48> 39 bf f8 00 00 00 0f 94 c0 c3 66 66 2e 0f 1f 84 00 00 00 00 00
Oct 11 22:36:26 BS-Server2 kernel: [115738.861088] traps: nm-applet[93189] trap int3 ip:7f04ad3a20d5 sp:7ffc72c8b330 error:0 in libglib-2.0.so.0.6400.3[7f04ad36600
0+84000]
Oct 11 22:36:33 BS-Server2 org.xfce.ScreenSaver[93124]: Xlib: extension "DPMS" missing on display ":1".
Oct 11 22:36:48 BS-Server2 org.xfce.ScreenSaver[93124]: Xlib: extension "DPMS" missing on display ":1".
Oct 11 22:37:03 BS-Server2 org.xfce.ScreenSaver[93124]: Xlib: extension "DPMS" missing on display ":1".
但是,当服务器冻结时,我没有收到其他错误消息,系统日志仅显示:
Oct 11 22:38:33 BS-Server2 org.xfce.ScreenSaver[93124]: message repeated 6 times: [ Xlib: extension "DPMS" missing on display ":1".]
Oct 11 22:38:48 BS-Server2 org.xfce.ScreenSaver[93124]: Xlib: extension "DPMS" missing on display ":1".
它被卡住了。
我的印象是,当我几分钟(例如 5 分钟)没有在 VNC 窗口中工作时,就会发生冻结。困难的是不会出现错误消息。
有什么想法吗?该设置多年来一直运行良好,直到 Ubuntu 18。我特意切换到 xfce,因为其他 vnc 服务器出现问题,但现在我被困在没有 VNC 的情况下 - 它是我的 Ubuntu 环境的基石。
答案1
我卸载了tightvncserver:
sudo aptitude remove tightvncserver
并安装 tigervnc:
sudo aptitude install tigervnc
就我而言,我必须编辑 /etc/vnc.conf,因为默认设置对我来说不起作用,但 YMMV。
10 分钟后,不再冻结,并且 xfce4 窗口现在可以正确绘制其窗口边框和控件。
答案2
问题:
Oct 11 22:38:33 BS-Server2 org.xfce.ScreenSaver[93124]: message repeated 6 times: [ Xlib: extension "DPMS" missing on display ":1".]
无头服务器尝试执行(哎呀!) 屏幕保护程序是无用的(它是一个无头服务器),然后系统等待屏幕保护程序退出,这将失败。我无法确切地告诉你发生了什么,但屏幕保护程序不会正确运行,而服务器仍然等待退出事件,而退出事件永远不会发生。
解决方案:禁用无头设备上的屏幕保护程序,一切就都好了。重新启动无头 vncserver,通过 VNC 连接并禁用屏幕保护程序。
答案3
目前,我创建了一个小脚本,可以终止所有 Xvnc 进程和相关锁,并再次启动 vnc 进程。虽然不好看,但可以工作
killall Xvnc4
sudo rm -r /tmp/.X*
exec ./vncstart1680
最后一个是:
#!/bin/sh
#echo resetting keyboard..
#gconftool --set /desktop/gnome/peripherals/keyboard/kbd/layouts --type List --list
-type String [aa]
echo starting vnc X session..
vncserver -geometry 1680x1050 -depth 24 -localhost
答案4
在 Ubuntu Studio 20.04LTS 上,不会出现此错误,但在 Ubuntu Studio 22.04LTS 上,xfce4 会出现此错误。最后,我删除了屏幕保护程序:sudo apt remove xfce4-screensaver,它工作正常。