当源 VNC 服务器连接到 x11vnc -reflect listen 时,它会崩溃

当源 VNC 服务器连接到 x11vnc -reflect listen 时,它会崩溃

我想在反射模式和反向/监听连接模式下运行 x11vnc。因此,x11vnc 将充当另一个 vnc 服务器的中继器,并等待第二个 vnc 服务器连接到自身。以下是命令:

root@vnc-server:~# x11vnc -reflect listen:5900 -nopw
15/07/2022 10:07:15 x11vnc version: 0.9.16 lastmod: 2019-01-05  pid: 127624
15/07/2022 10:07:15 Not opening DISPLAY in -rawfb mode (force via -rawfb +str)
15/07/2022 10:07:15 Continuing without X display in -rawfb mode.
15/07/2022 10:07:15 rfbGetClient(bitsPerSample=8, samplesPerPixel=3, bytesPerPixel=4)
15/07/2022 10:07:15 rawfb: vnc:listen:5900
15/07/2022 10:07:15  -listen: Listening on port 5900
15/07/2022 10:07:15  -listen: Command line errors are not reported until a connection comes in.
15/07/2022 10:07:15  -listen: Listening on IPV6 port 5900
15/07/2022 10:07:15  -listen: Command line errors are not reported until a connection comes in.

然后进行telnet测试:

root@vnc-server:~# telnet localhost 5900
Trying ::1...
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection reset by peer

这总是导致 x11vnc :

15/07/2022 10:07:18 AcceptTcpConnection: accept
15/07/2022 10:07:18 read (9: Bad file descriptor)
15/07/2022 10:07:18 vnc_reflector failed for: vnc:listen:5900

如果我测试它与真实源 VNC 服务器的连接,x11vnc -connect vncserver:5900结果是相同的。

我已经发现(对我而言,它不适用于 listennofork)从 9 年前开始就没有答案了,而且我还没有找到任何解决方案。

这里还有谁知道更好的办法吗?谢谢您的宝贵时间。

x11vnc 版本:0.9.16 最后修改时间:2019-01-05

编辑:额外信息

我已经使用装有 openSuse 15.4 的笔记本电脑和装有 openSuse 15.3 的 WM 进行了测试,结果相同:

x11vnc 反映服务器的输出:

user@localhost:~> x11vnc -reflect listen:6000 -nopw
15/07/2022 18:40:59 x11vnc version: 0.9.16 lastmod: 2019-01-05  pid: 74413
15/07/2022 18:40:59 Not opening DISPLAY in -rawfb mode (force via -rawfb +str)
15/07/2022 18:40:59 Continuing without X display in -rawfb mode.
15/07/2022 18:40:59 rfbGetClient(bitsPerSample=8, samplesPerPixel=3, bytesPerPixel=4)
15/07/2022 18:40:59 rawfb: vnc:listen:6000
15/07/2022 18:40:59  -listen: Listening on port 6000
15/07/2022 18:40:59  -listen: Command line errors are not reported until a connection comes in.
15/07/2022 18:41:51 AcceptTcpConnection: accept
15/07/2022 18:41:51 read (9: Bad file descriptor)
15/07/2022 18:41:51 vnc_reflector failed for: vnc:listen:6000

telnet 测试的输出:

telnet 127.0.0.1 6000
localhost:~ # telnet 127.0.0.1 6000
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.

尝试连接反射器的源 VNC 服务器的输出:

user@localhost:~> x11vnc -connect 127.0.0.1:6000 -nopw -display :0   
15/07/2022 18:41:51 x11vnc version: 0.9.16 lastmod: 2019-01-05  pid: 74425
15/07/2022 18:41:51 Using X display :0
15/07/2022 18:41:51 rootwin: 0x4dd reswin: 0x6000001 dpy: 0xeb2e0f20
15/07/2022 18:41:51 
15/07/2022 18:41:51 ------------------ USEFUL INFORMATION ------------------
15/07/2022 18:41:51 X DAMAGE available on display, using it for polling hints.
15/07/2022 18:41:51   To disable this behavior use: '-noxdamage'
15/07/2022 18:41:51 
15/07/2022 18:41:51   Most compositing window managers like 'compiz' or 'beryl'
15/07/2022 18:41:51   cause X DAMAGE to fail, and so you may not see any screen
15/07/2022 18:41:51   updates via VNC.  Either disable 'compiz' (recommended) or
15/07/2022 18:41:51   supply the x11vnc '-noxdamage' command line option.
15/07/2022 18:41:51 
15/07/2022 18:41:51 Wireframing: -wireframe mode is in effect for window moves.
15/07/2022 18:41:51   If this yields undesired behavior (poor response, painting
15/07/2022 18:41:51   errors, etc) it may be disabled:
15/07/2022 18:41:51    - use '-nowf' to disable wireframing completely.
15/07/2022 18:41:51    - use '-nowcr' to disable the Copy Rectangle after the
15/07/2022 18:41:51      moved window is released in the new position.
15/07/2022 18:41:51   Also see the -help entry for tuning parameters.
15/07/2022 18:41:51   You can press 3 Alt_L's (Left "Alt" key) in a row to 
15/07/2022 18:41:51   repaint the screen, also see the -fixscreen option for
15/07/2022 18:41:51   periodic repaints.
15/07/2022 18:41:51 
15/07/2022 18:41:51 XFIXES available on display, resetting cursor mode
15/07/2022 18:41:51   to: '-cursor most'.
15/07/2022 18:41:51   to disable this behavior use: '-cursor arrow'
15/07/2022 18:41:51   or '-noxfixes'.
15/07/2022 18:41:51 using XFIXES for cursor drawing.
15/07/2022 18:41:51 GrabServer control via XTEST.
15/07/2022 18:41:51 
15/07/2022 18:41:51 Scroll Detection: -scrollcopyrect mode is in effect to
15/07/2022 18:41:51   use RECORD extension to try to detect scrolling windows
15/07/2022 18:41:51   (induced by either user keystroke or mouse input).
15/07/2022 18:41:51   If this yields undesired behavior (poor response, painting
15/07/2022 18:41:51   errors, etc) it may be disabled via: '-noscr'
15/07/2022 18:41:51   Also see the -help entry for tuning parameters.
15/07/2022 18:41:51   You can press 3 Alt_L's (Left "Alt" key) in a row to 
15/07/2022 18:41:51   repaint the screen, also see the -fixscreen option for
15/07/2022 18:41:51   periodic repaints.
15/07/2022 18:41:51 
15/07/2022 18:41:51 XKEYBOARD:
15/07/2022 18:41:51 Switching to -xkb mode to recover these keysyms:
15/07/2022 18:41:51    xkb  noxkb   Keysym  ("X" means present)
15/07/2022 18:41:51    ---  -----   -----------------------------
15/07/2022 18:41:51     X           0x40  at
15/07/2022 18:41:51     X           0x23  numbersign
15/07/2022 18:41:51     X           0x5b  bracketleft
15/07/2022 18:41:51     X           0x5d  bracketright
15/07/2022 18:41:51     X           0x7b  braceleft
15/07/2022 18:41:51     X           0x7d  braceright
15/07/2022 18:41:51     X           0x7c  bar
15/07/2022 18:41:51     X           0x5c  backslash
15/07/2022 18:41:51 
15/07/2022 18:41:51   If this makes the key mapping worse you can
15/07/2022 18:41:51   disable it with the "-noxkb" option.
15/07/2022 18:41:51 
15/07/2022 18:41:51 
15/07/2022 18:41:51 X FBPM extension not supported.
15/07/2022 18:41:51 X display is capable of DPMS.
15/07/2022 18:41:51 --------------------------------------------------------
15/07/2022 18:41:51 
15/07/2022 18:41:51 Default visual ID: 0x21
15/07/2022 18:41:51 Read initial data from X display into framebuffer.
15/07/2022 18:41:51 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/7680
15/07/2022 18:41:51 
15/07/2022 18:41:51 X display :0 is 32bpp depth=24 true color
15/07/2022 18:41:51 
15/07/2022 18:41:51 Autoprobing TCP port 
15/07/2022 18:41:51 Autoprobing selected TCP port 5900
15/07/2022 18:41:51 Autoprobing TCP6 port 
15/07/2022 18:41:51 Autoprobing selected TCP6 port 5900
15/07/2022 18:41:51 listen6: bind: Address already in use
15/07/2022 18:41:51 Not listening on IPv6 interface.
15/07/2022 18:41:51 
15/07/2022 18:41:51 Xinerama is present and active (e.g. multi-head).
15/07/2022 18:41:51 Xinerama: number of sub-screens: 1
15/07/2022 18:41:51 Xinerama: no blackouts needed (only one sub-screen)
15/07/2022 18:41:51 
15/07/2022 18:41:51 fb read rate: 2189 MB/sec
15/07/2022 18:41:51 fast read: reset -wait  ms to: 10
15/07/2022 18:41:51 fast read: reset -defer ms to: 10
15/07/2022 18:41:51 The X server says there are 12 mouse buttons.
15/07/2022 18:41:51 screen setup finished.
15/07/2022 18:41:51 

The VNC desktop is:      localhost.localdomain:0
PORT=5900

******************************************************************************
Have you tried the x11vnc '-ncache' VNC client-side pixel caching feature yet?

The scheme stores pixel data offscreen on the VNC viewer side for faster
retrieval.  It should work with any VNC viewer.  Try it by running:

    x11vnc -ncache 10 ...

One can also add -ncache_cr for smooth 'copyrect' window motion.
More info: http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching

15/07/2022 18:41:51 Making connection to client on host 127.0.0.1 port 6000
15/07/2022 18:41:51   other clients:
15/07/2022 18:41:51 webSocketsHandshake: unknown connection error
15/07/2022 18:41:51 Client 127.0.0.1 gone
15/07/2022 18:41:51 Statistics             events    Transmit/ RawEquiv ( saved)
15/07/2022 18:41:51  TOTALS              :      0 |         0/        0 (  0.0%)
15/07/2022 18:41:51 Statistics             events    Received/ RawEquiv ( saved)
15/07/2022 18:41:51  TOTALS              :      0 |         0/        0 (  0.0%)
15/07/2022 18:41:51 connect_tcp: trying:   127.0.0.1 6000
15/07/2022 18:41:51 rfbConnectToTcoAddr: failed to connect
: Connection refused
15/07/2022 18:41:51 connect_tcp: connection failed: Connection refused
15/07/2022 18:41:51 connect_tcp: re-trying 127.0.0.1 6000
15/07/2022 18:41:51 rfbConnectToTcoAddr: failed to connect
: Connection refused
15/07/2022 18:41:51 connect_tcp: connection failed: Connection refused
15/07/2022 18:41:51 connect_tcp: trying IPv6 127.0.0.1 6000
15/07/2022 18:41:51 connect_tcp[ipv6]: trying sock=10 fam=10 proto=6 using ::1
15/07/2022 18:41:51 connect_tcp[ipv6]: connect: Connection refused
15/07/2022 18:41:51 connect_tcp[ipv6]: trying again with IPV6_V6ONLY=0
15/07/2022 18:41:51 connect_tcp[ipv6]: connect: Connection refused
15/07/2022 18:41:51 reverse_connect: 127.0.0.1:6000 failed

令人惊讶的是,在 openSUSE 中,我必须以非特权用户而不是 root 身份运行 vnc 命令,因为作为 root,我收到无法打开显示 :0 的错误。但我认为这与此无关。

相关内容