2

I want to run x11vnc in reflect mode and reverse/listenning connection mode. So, x11vnc it's going to act as a repeater for another vnc server and it's going to wait for this second vnc server to connect to itself. Here it's the command:

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.

Then doing telnet for testing:

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

Which always leads x11vnc to:

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

If I test it connecting with the real source VNC server with x11vnc -connect vncserver:5900 the result it's the same.

I have found this (with the difference that for me it doesn't work with listennofork neither) from 9 years ago but... no answer and I haven't been able to find any solution.

Do anyone here knows any better? Thanks for your time.

x11vnc version: 0.9.16 lastmod: 2019-01-05

EDIT: Extra info

I have tested with a laptop with openSuse 15.4 and a WM with opensuse 15.3 with the same results:

Output of the x11vnc reflect server:

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

Output of the telnet testing:

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.

Output of the source VNC server trying to connect to the reflector:

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

Surprisingly in opensuse I had to run the vnc commands as unprivileged user instead of root because as root I was getting errors about unable to open display :0. But I supose that this has nothing to do.

5
  • Is the simpler case - reverse connection setup, but without reflector - working?
    – anx
    Jul 15, 2022 at 8:52
  • I don't know how to test it becuase it's a headless server without any monitor attached to it. If I run x11vnc as "standard" server it has no display to connect to it and exits.
    – Héctor
    Jul 15, 2022 at 9:37
  • ssh port forward and attach a client from somewhere you do have a monitor, then?
    – anx
    Jul 15, 2022 at 15:33
  • 1
    Wise man says wise words that noob monke do not know how to interpret. If wise man explains how, monke could try. In the other hand I have updated my post with extra info/testing. Taking into acount your first comment I tried in a laptop (and in a WM with exact same results) x11vnc -connect 127.0.0.1:5900 and vncviewer -listen 5900 and it has connected succesfully meanwhile the reflector mode hasn't. I know it's not the same environment as the server but maybe it's enough for you. Summarizing, reverse connection has worked, reverse + reflector has returned the same error as in the server.
    – Héctor
    Jul 15, 2022 at 16:49
  • Sorry @anx, I'm very tired. I have understand you now. I will try it, but looking at the results on my laptop & VM were the reflector bug has been reproduced and the standard reverse connection has worked I don't keep any hope.
    – Héctor
    Jul 15, 2022 at 17:14

0

You must log in to answer this question.

Browse other questions tagged .