[root@host1 fx-vnc]# docker run --rm -p 5900:5900 fx-vnc
19/09/2025 15:13:01 -usepw: found /root/.vnc/passwd
19/09/2025 15:13:01 x11vnc version: 0.9.16 lastmod: 2019-01-05 pid: 9
19/09/2025 15:13:01 Using X display :0
19/09/2025 15:13:01 rootwin: 0x50e reswin: 0x200001 dpy: 0xb664eba0
19/09/2025 15:13:01
19/09/2025 15:13:01 ------------------ USEFUL INFORMATION ------------------
19/09/2025 15:13:01 X DAMAGE available on display, using it for polling hints.
19/09/2025 15:13:01 To disable this behavior use: '-noxdamage'
19/09/2025 15:13:01
19/09/2025 15:13:01 Most compositing window managers like 'compiz' or 'beryl'
19/09/2025 15:13:01 cause X DAMAGE to fail, and so you may not see any screen
19/09/2025 15:13:01 updates via VNC. Either disable 'compiz' (recommended) or
19/09/2025 15:13:01 supply the x11vnc '-noxdamage' command line option.
19/09/2025 15:13:01
19/09/2025 15:13:01 Wireframing: -wireframe mode is in effect for window moves.
19/09/2025 15:13:01 If this yields undesired behavior (poor response, painting
19/09/2025 15:13:01 errors, etc) it may be disabled:
19/09/2025 15:13:01 - use '-nowf' to disable wireframing completely.
19/09/2025 15:13:01 - use '-nowcr' to disable the Copy Rectangle after the
19/09/2025 15:13:01 moved window is released in the new position.
19/09/2025 15:13:01 Also see the -help entry for tuning parameters.
19/09/2025 15:13:01 You can press 3 Alt_L's (Left "Alt" key) in a row to
19/09/2025 15:13:01 repaint the screen, also see the -fixscreen option for
19/09/2025 15:13:01 periodic repaints.
19/09/2025 15:13:01
19/09/2025 15:13:01 XFIXES available on display, resetting cursor mode
19/09/2025 15:13:01 to: '-cursor most'.
19/09/2025 15:13:01 to disable this behavior use: '-cursor arrow'
19/09/2025 15:13:01 or '-noxfixes'.
19/09/2025 15:13:01 using XFIXES for cursor drawing.
19/09/2025 15:13:01 GrabServer control via XTEST.
19/09/2025 15:13:01
19/09/2025 15:13:01 Scroll Detection: -scrollcopyrect mode is in effect to
19/09/2025 15:13:01 use RECORD extension to try to detect scrolling windows
19/09/2025 15:13:01 (induced by either user keystroke or mouse input).
19/09/2025 15:13:01 If this yields undesired behavior (poor response, painting
19/09/2025 15:13:01 errors, etc) it may be disabled via: '-noscr'
19/09/2025 15:13:01 Also see the -help entry for tuning parameters.
19/09/2025 15:13:01 You can press 3 Alt_L's (Left "Alt" key) in a row to
19/09/2025 15:13:01 repaint the screen, also see the -fixscreen option for
19/09/2025 15:13:01 periodic repaints.
19/09/2025 15:13:01
19/09/2025 15:13:01 XKEYBOARD: number of keysyms per keycode 7 is greater
19/09/2025 15:13:01 than 4 and 51 keysyms are mapped above 4.
19/09/2025 15:13:01 Automatically switching to -xkb mode.
19/09/2025 15:13:01 If this makes the key mapping worse you can
19/09/2025 15:13:01 disable it with the "-noxkb" option.
19/09/2025 15:13:01 Also, remember "-remap DEAD" for accenting characters.
19/09/2025 15:13:01
19/09/2025 15:13:01 X FBPM extension not supported.
Xlib: extension "DPMS" missing on display ":0".
19/09/2025 15:13:01 X display is not capable of DPMS.
19/09/2025 15:13:01 --------------------------------------------------------
19/09/2025 15:13:01
19/09/2025 15:13:01 Default visual ID: 0x21
19/09/2025 15:13:01 Read initial data from X display into framebuffer.
19/09/2025 15:13:01 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/5120
19/09/2025 15:13:01
19/09/2025 15:13:01 X display :0 is 32bpp depth=24 true color
19/09/2025 15:13:01
19/09/2025 15:13:01 Autoprobing TCP port
19/09/2025 15:13:01 Autoprobing selected TCP port 5900
19/09/2025 15:13:01 Autoprobing TCP6 port
19/09/2025 15:13:01 Autoprobing selected TCP6 port 5900
19/09/2025 15:13:01 listen6: bind: Address already in use
19/09/2025 15:13:01 Not listening on IPv6 interface.
19/09/2025 15:13:01
19/09/2025 15:13:01 Xinerama is present and active (e.g. multi-head).
19/09/2025 15:13:01 Xinerama: number of sub-screens: 1
19/09/2025 15:13:01 Xinerama: no blackouts needed (only one sub-screen)
19/09/2025 15:13:01
19/09/2025 15:13:01 fb read rate: 460 MB/sec
19/09/2025 15:13:01 fast read: reset -wait ms to: 10
19/09/2025 15:13:01 fast read: reset -defer ms to: 10
19/09/2025 15:13:01 The X server says there are 10 mouse buttons.
19/09/2025 15:13:01 screen setup finished.
19/09/2025 15:13:01
The VNC desktop is: 7ce82faa0611:0
******************************************************************************
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
PORT=5900
[GFX1-]: glxtest: libpci missing
[GFX1-]: glxtest: libEGL missing
[Parent 10, Main Thread] WARNING: Failed to create DBus proxy for org.a11y.Bus: Failed to execute child process “dbus-launch” (No such file or directory)
: 'glib warning', file /build/firefox-gUwsIg/firefox-136.0+build3/toolkit/xre/nsSigHandlers.cpp:201
** (firefox:10): WARNING **: 15:13:03.700: Failed to create DBus proxy for org.a11y.Bus: Failed to execute child process ?dbus-launch? (No such file or directory)
^C^Z
^C
exit
fg^C
got 3 SIGTERM/SIGINTs, forcefully exiting
[root@host1 fx-vnc]# vi Dockerfile
[root@host1 fx-vnc]# cat Dockerfile
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && \
apt install -y --no-install-recommends \
x11vnc \
xvfb \
firefox \
libpci3 \
libegl1 \
dbus-x11 \
&& \
apt clean && \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p /root/.vnc
RUN x11vnc -storepasswd 1234 /root/.vnc/passwd
EXPOSE 5900
CMD ["bash", "-c", "Xvfb :0 -screen 0 1280x720x24 & export DISPLAY=:0 && firefox & x11vnc -forever -usepw -display :0"]
[root@host1 fx-vnc]# docker build -t fx-vnc .
[+] Building 476.4s (8/8) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 649B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:20.04 21.8s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> CACHED [1/4] FROM docker.io/library/ubuntu:20.04@sha256:8feb4d8ca5354def3d8fce243717141ce3 0.0s
=> [2/4] RUN apt update && apt install -y --no-install-recommends x11vnc 448.8s
=> [3/4] RUN mkdir -p /root/.vnc 0.4s
=> [4/4] RUN x11vnc -storepasswd 1234 /root/.vnc/passwd 0.6s
=> exporting to image 4.8s
=> => exporting layers 4.8s
=> => writing image sha256:39a47410fb4e5df0294a0fd01fd7a430ea7d88cd5011f4343f6846bfaeadef1c 0.0s
=> => naming to docker.io/library/fx-vnc 0.0s
[root@host1 fx-vnc]# docker rm -f fx-vnc-container
Error response from daemon: No such container: fx-vnc-container
[root@host1 fx-vnc]# docker run --rm -p 5900:5900 fx-vnc
docker: Error response from daemon: failed to set up container networking: driver failed programming external connectivity on endpoint modest_wiles (e7110f4b7625de2268902d0f2c54bcd23d9b8be2e943ba3046b3781cb580f2eb): Bind for 0.0.0.0:5900 failed: port is already allocated
Run 'docker run --help' for more information
[root@host1 fx-vnc]# ss -tulnp | grep 5900
tcp LISTEN 0 4096 0.0.0.0:5900 0.0.0.0:* users:(("docker-proxy",pid=556547,fd=7))
tcp LISTEN 0 4096 [::]:5900 [::]:* users:(("docker-proxy",pid=556555,fd=7))
[root@host1 fx-vnc]# docker ps | grep $(ps -p 12345 -o ppid=)
用法: grep [选项]... 模式 [文件]...
尝试使用 'grep --help' 来获得更多信息。
[root@host1 fx-vnc]# PPID=$(ps -p 556547 -o ppid= | tr -d ' ')
-bash: PPID:只读变量
[root@host1 fx-vnc]# docker ps | grep $PPID
[root@host1 fx-vnc]# docker ps -a --filter "publish=5900"
CONTAINER ID IMAGE