x11vnc 无法连接到 gdmgreeter 的 X 服务器

x11vnc 无法连接到 gdmgreeter 的 X 服务器

操作系统:CentOS 8.3

GDM 为欢迎程序创建一个 X 服务器,并为每个登录的用户创建一个不同的 X 服务器。我正在尝试运行 x11vnc 来启用对机器的远程访问,但是 x11vnc 被 X 服务器拒绝。

如何运行 x11vnc 以便它能够连接到“greeter”显示器?

附加详细信息:X服务器进程如下:

~]# ps -ef | grep X
gdm 347880 347876 0 00:59 tty1 00:00:00 /usr/libexec/Xorg vt1 -displayfd 3 -auth /run/user/42/gdm/Xauthority -background none -noreset -keeptty -verbose 3

尝试按如下方式运行 x11vnc:

x11vnc -rfbauth /etc/vncpasswd -auth /run/user/42/gdm/Xauthority -display :0

结果是:

X11 MIT Shared Memory Attach failed:
  Is your DISPLAY=:0 on a remote machine?
  Suggestion, use: x11vnc -display :0 ... for local display :0

caught X11 error:
03/05/2021 14:44:56 deleted 32 tile_row polling images.
X Error of failed request:  BadAccess (attempt to access private resource denied)
  Major opcode of failed request:  130 (MIT-SHM)
  Minor opcode of failed request:  1 (X_ShmAttach)
  Serial number of failed request:  55
  Current serial number in output stream:  89

Wayland 已禁用:

~]# cat /etc/gdm/custom.conf
# GDM configuration storage

[daemon]
# Uncoment the line below to force the login screen to use Xorg
WaylandEnable=false

[security]

[xdmcp]
Enable=true

[chooser]

[debug]
# Uncomment the line below to turn on debugging
#Enable=true

有趣的是,通过稍旧的安装,x11vnc 成功连接到 Xorg 服务器,并且我能够使用 vnc 客户端连接到机器。

我发现 Xorg 的 (小) 版本不同。在 x11vnc 成功运行的系统中:

~]# Xorg -version

X.Org X Server 1.20.6
X Protocol Version 11, Revision 0
Build Operating System:  4.19.34-300.el7.x86_64
Current Operating System: Linux centos01.dev.infinigon.local 4.18.0-193.28.1.el8_2.x86_64 #1 SMP Thu Oct 22 00:20:22 UTC 2020 x86_64
Kernel command line: BOOT_IMAGE=(hd1,gpt2)/vmlinuz-4.18.0-193.28.1.el8_2.x86_64 root=/dev/mapper/cl-root ro crashkernel=auto resume=/dev/mapper/cl-swap rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet intel_idle.max_cstate=1
Build Date: 24 April 2020  02:49:29AM
Build ID: xorg-x11-server 1.20.6-3.el8
Current version of pixman: 0.38.4
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.

在 x11vnc 存在的系统中:

~]# Xorg -version

X.Org X Server 1.20.8
X Protocol Version 11, Revision 0
Build Operating System:  4.19.34-300.el7.x86_64
Current Operating System: Linux lab82dev 4.18.0-240.1.1.el8_3.x86_64 #1 SMP Thu Nov 19 17:20:08 UTC 2020 x86_64
Kernel command line: BOOT_IMAGE=(hd1,gpt2)/vmlinuz-4.18.0-240.1.1.el8_3.x86_64 root=/dev/mapper/cl-root ro crashkernel=auto resume=/dev/mapper/cl-swap rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet
Build Date: 24 August 2020  06:49:47PM
Build ID: xorg-x11-server 1.20.8-6.el8
Current version of pixman: 0.38.4
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.

答案1

以 gdm 用户身份运行 x11vnc:

sudo -u gdm x11vnc -rfbauth /etc/vncpasswd -auth /run/user/42/gdm/Xauthority -display :0

相关内容