northsea4 / mdcx-docker

在Docker容器中运行 MDCX,并通过Web界面或远程桌面进行控制。Run MDCX in a Docker container, accessible and controllable via a web interface or remote desktop.
GNU General Public License v3.0
605 stars 78 forks source link

[BUG] libQt5Core.so.5: cannot open shared object file: No such file or directory #18

Closed iian closed 1 year ago

iian commented 1 year ago

是否存在已有问题?

问题描述

容器启动后停止。 日志提示: [app         ] ImportError: libQt5Core.so.5: cannot open shared object file: No such file or directory 2023-05-20T12:20:29.795447042Z | stdout | [app         ]   File "MDCx_Main.py", line 16, in  2023-05-20T12:20:29.794437046Z | stdout | [app         ] Traceback (most recent call last):

预期表现

No response

复现步骤

环境

- 操作系统:Synology DSM 7.1.1-42962 Update 5
- Docker服务安装方式: Docker 20.10.3-1308

CPU架构

arm64

使用的镜像

mdcx-builtin-webtop-base

Docker创建方式

version: '3'

services:
  mdcx:
    image: stainless403/mdcx-builtin-gui-base:${MDCX_BUILTIN_IMAGE_TAG}
    container_name: ${MDCX_CONTAINER_NAME}
    env_file:
      - .env
    volumes:
      # 系统数据目录
      - ./data:/config

      # 配置文件目录
      - ./mdcx-config:/mdcx-config
      # `配置文件目录`标记文件
      - ./mdcx-config/MDCx.config:/app/MDCx.config

      # 日志目录
      - ./logs:/app/Log

      # 影片目录
      # /path/to/movies:/movies
      # VOLUMES_REPLACEMENT
    # environment:
    ports:
      - ${WEB_PORT}:5800
      - ${VNC_PORT}:5900
    restart: unless-stopped
    network_mode: bridge
    stdin_open: true

容器日志

[init        ] container is starting...
[cont-env    ] loading container environment variables...
[cont-env    ] APP_NAME: loading...
[cont-env    ] DISPLAY: executing...
[cont-env    ] DISPLAY: terminated successfully.
[cont-env    ] DISPLAY: loading...
[cont-env    ] DOCKER_IMAGE_PLATFORM: loading...
[cont-env    ] GTK_THEME: executing...
[cont-env    ] GTK_THEME: terminated successfully.
[cont-env    ] GTK_THEME: loading...
[cont-env    ] HOME: loading...
[cont-env    ] QT_STYLE_OVERRIDE: executing...
[cont-env    ] QT_STYLE_OVERRIDE: terminated successfully.
[cont-env    ] QT_STYLE_OVERRIDE: loading...
[cont-env    ] TAKE_CONFIG_OWNERSHIP: loading...
[cont-env    ] XDG_CACHE_HOME: loading...
[cont-env    ] XDG_CONFIG_HOME: loading...
[cont-env    ] XDG_DATA_HOME: loading...
[cont-env    ] XDG_RUNTIME_DIR: loading...
[cont-env    ] XDG_STATE_HOME: loading...
[cont-env    ] container environment variables initialized.
[cont-secrets] loading container secrets...
[cont-secrets] container secrets loaded.
[cont-init   ] executing container initialization scripts...
[cont-init   ] 10-certs.sh: executing...
[cont-init   ] 10-certs.sh: terminated successfully.
[cont-init   ] 10-check-app-niceness.sh: executing...
[cont-init   ] 10-check-app-niceness.sh: terminated successfully.
[cont-init   ] 10-cjk-font.sh: executing...
[cont-init   ] 10-cjk-font.sh: CJK font already installed.
[cont-init   ] 10-cjk-font.sh: terminated successfully.
[cont-init   ] 10-clean-logmonitor-states.sh: executing...
[cont-init   ] 10-clean-logmonitor-states.sh: terminated successfully.
[cont-init   ] 10-clean-tmp-dir.sh: executing...
[cont-init   ] 10-clean-tmp-dir.sh: terminated successfully.
[cont-init   ] 10-fontconfig-cache-dir.sh: executing...
[cont-init   ] 10-fontconfig-cache-dir.sh: terminated successfully.
[cont-init   ] 10-init-users.sh: executing...
[cont-init   ] 10-init-users.sh: terminated successfully.
[cont-init   ] 10-nginx.sh: executing...
[cont-init   ] 10-nginx.sh: terminated successfully.
[cont-init   ] 10-openbox.sh: executing...
[cont-init   ] 10-openbox.sh: terminated successfully.
[cont-init   ] 10-set-tmp-dir-perms.sh: executing...
[cont-init   ] 10-set-tmp-dir-perms.sh: terminated successfully.
[cont-init   ] 10-vnc-password.sh: executing...
[cont-init   ] 10-vnc-password.sh: creating VNC password file from environment variable...
[cont-init   ] 10-vnc-password.sh: terminated successfully.
[cont-init   ] 10-web-data.sh: executing...
[cont-init   ] 10-web-data.sh: terminated successfully.
[cont-init   ] 10-x11-unix.sh: executing...
[cont-init   ] 10-x11-unix.sh: terminated successfully.
[cont-init   ] 10-xdg-runtime-dir.sh: executing...
[cont-init   ] 10-xdg-runtime-dir.sh: terminated successfully.
[cont-init   ] 15-install-pkgs.sh: executing...
[cont-init   ] 15-install-pkgs.sh: terminated successfully.
[cont-init   ] 250-do-me-a-favor.sh: executing...
[cont-init   ] 250-do-me-a-favor.sh: 😁 take-ownership: /app and /mdcx-config
[cont-init   ] 250-do-me-a-favor.sh: terminated successfully.
[cont-init   ] 85-take-config-ownership.sh: executing...
[cont-init   ] 85-take-config-ownership.sh: terminated successfully.
[cont-init   ] 89-info.sh: executing...
    ╭――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――╮
    │                                                                      │
    │ Application:           MDCx                                          │
    │ Application Version:   n/a                                           │
    │ Docker Image Version:  n/a                                           │
    │ Docker Image Platform: linux/amd64                                   │
    │                                                                      │
    ╰――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――╯
[cont-init   ] 89-info.sh: terminated successfully.
[cont-init   ] all container initialization scripts executed.
[init        ] giving control to process supervisor.
[supervisor  ] loading services...
[supervisor  ] loading service 'default'...
[supervisor  ] loading service 'app'...
[supervisor  ] loading service 'gui'...
[supervisor  ] loading service 'certsmonitor'...
[supervisor  ] service 'certsmonitor' is disabled.
[supervisor  ] loading service 'nginx'...
[supervisor  ] loading service 'xvnc'...
[supervisor  ] loading service 'openbox'...
[supervisor  ] loading service 'logmonitor'...
[supervisor  ] service 'logmonitor' is disabled.
[supervisor  ] loading service 'logrotate'...
[supervisor  ] all services loaded.
[supervisor  ] starting services...
[supervisor  ] starting service 'xvnc'...
[xvnc        ] Xvnc TigerVNC 1.12.0 - built Feb 14 2023 18:02:00
[xvnc        ] Copyright (C) 1999-2021 TigerVNC Team and many others (see README.rst)
[xvnc        ] See https://www.tigervnc.org for information on TigerVNC.
[xvnc        ] Underlying X server release 12013000, The X.Org Foundation
[xvnc        ] Sat May 20 20:25:08 2023
[xvnc        ]  vncext:      VNC extension running!
[xvnc        ]  vncext:      Listening for VNC connections on /tmp/vnc.sock (mode 0660)
[xvnc        ]  vncext:      Listening for VNC connections on all interface(s), port 5900
[xvnc        ]  vncext:      created VNC server for screen 0
[supervisor  ] starting service 'nginx'...
[nginx       ] Listening for HTTP connections on port 5800.
[supervisor  ] starting service 'openbox'...
[supervisor  ] starting service 'app'...
[app         ] ⏳ 启动MDCx...
[supervisor  ] all services started.
[app         ] Traceback (most recent call last):
[app         ]   File "MDCx_Main.py", line 16, in <module>
[app         ] ImportError: libQt5Core.so.5: cannot open shared object file: No such file or directory
[app         ] [614] Failed to execute script 'MDCx_Main' due to unhandled exception!
[supervisor  ] service 'app' exited (with status 1).
[supervisor  ] service 'app' exited, shutting down...
[supervisor  ] stopping service 'openbox'...
[supervisor  ] service 'openbox' exited (with status 0).
[supervisor  ] stopping service 'nginx'...
[supervisor  ] service 'nginx' exited (with status 0).
[supervisor  ] stopping service 'xvnc'...
[xvnc        ] Sat May 20 20:25:16 2023
[xvnc        ]  ComparingUpdateTracker: 0 pixels in / 0 pixels out
[xvnc        ]  ComparingUpdateTracker: (1:-nan ratio)
[supervisor  ] service 'xvnc' exited (with status 0).
[finish      ] executing container finish scripts...
[finish      ] all container finish scripts executed.
northsea4 commented 1 year ago

我在 DSM6.2.3(x86_64, docker 20.10.3)macOS 13 (arm64) 复现不了这个问题,都能正常运行,也不具备跟你相似的环境去测试。

请确认拉取的是最新的镜像。 可以把 image: stainless403/mdcx-builtin-gui-base:${MDCX_BUILTIN_IMAGE_TAG} 修改为 image: stainless403/mdcx-builtin-gui-base:20230413

iian commented 1 year ago

指定镜像也不行,目前就在以下环境下不行,在Ubuntu 22.04中测试没问题。

操作系统:Synology DSM 7.1.1-42962 Update 5 Docker服务安装方式: Docker 20.10.3-1308

iian commented 1 year ago

https://stackoverflow.com/questions/65562640/problems-with-dynamic-library-in-docker-container

查到一个类似的问题,需要重新构建镜像,增加:

RUN strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5

使用build-mdcx/Dockerfile.build-mdcx构建镜像失败,其中.mdcx_src中是哪些文件?build-mdcx/Dockerfile.build-mdcx-base中并没有此操作。

COPY build-mdcx/.mdcx_src /tmp/mdcx

northsea4 commented 1 year ago

建议先试一下源码版, mdcx-src-gui-base。 如果你的机器配置不错,也可以考虑一下 mdcx-builtin-webtop-basemdcx-src-webtop-base 这两个。

iian commented 1 year ago

mdcx-src-gui-base

mdcx_gui | [supervisor ] starting service 'app'... mdcx_gui | [app ] 🐍 Python版本: Python 3.10.6 mdcx_gui | [app ] ⏳ 初始化应用... mdcx_gui | [app ] ❌ 找不到 /app/requirements.txt ,请将MDCx应用目录映射到容器的 /app 目录,然后重启容器 mdcx_gui | [supervisor ] all services started. mdcx_gui | [supervisor ] service 'app' exited (with status 148). mdcx_gui | [supervisor ] service 'app' exited, shutting down... mdcx_gui | [supervisor ] stopping service 'openbox'...

mdcx-src-webtop-base

RDP连接: Xorg 输入账号密码登录后自动关闭 Xvnc 可以登录进去,但是不显示桌面 image

mdcx_webtop | Global configuration: mdcx_webtop | UseUnixSocket (derived): true mdcx_webtop | mdcx_webtop | Security configuration: mdcx_webtop | RestrictOutboundClipboard: false mdcx_webtop | mdcx_webtop | Chansrv configuration: mdcx_webtop | EnableFuseMount true mdcx_webtop | FuseMountName: thinclient_drives mdcx_webtop | FileMask: 077 mdcx_webtop | chansrv::main: using log file [/config/.local/share/xrdp/xrdp-chansrv.10.log]

mdcx-builtin-webtop-base 是同样的报错

libQt5Core.so.5: cannot open shared object file: No such file or directory

northsea4 commented 1 year ago

参考文档去部署 mdcx-src-gui-base , 实际上用部署脚本就可以很方便地部署。

暂时我不太方便研究 libQt5Core 的问题,你可以在 mdcx-builtin-webtop-base 环境试一下那个 strip 的操作。

northsea4 commented 1 year ago

@iian 构建了两个测试镜像,主要是在使用pyinstaller打包时指定了--strip参数。

stainless403/mdcx-builtin-gui-base:latest-dev

stainless403/mdcx-builtin-webtop-base:latest-dev

你可以在DSM环境测试一下。

iian commented 1 year ago

mdcx-builtin-gui-base:latest-dev 仍然报错 image

mdcx-builtin-webtop-base:latest-dev 仍然无法显示桌面内容 image

cont-init: info: running /etc/cont-init.d/10-prepare-desktop.sh [migrations] started [migrations] no migrations found cont-init: info: /etc/cont-init.d/10-prepare-desktop.sh exited 0


      _         ()
     | |  ___   _    __
     | | / __| | |  /  \
     | | \__ \ | | | () |
     |_| |___/ |_|  \__/

Brought to you by linuxserver.io

To support LSIO projects visit: https://www.linuxserver.io/donate/

GID/UID

User uid: 1024 User gid: 100

Generating 2048 bit rsa key...

ssl_gen_key_xrdp1 ok

saving to rsakeys.ini

............+....+..+.+........+....+.....+...+............+.......+...........+....+........+.......+.....+....+..+....+........+...+...+.+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++........+.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.............+.+...+..+.+........+......+....+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .+......+.+..+.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++....+..+.......+..+......+.........+....+.....+....+.....+...+...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+...+........+.......+..+......+...+................+.....+......+.......+......+..+.......+...+.........+.....+.+.....+....+........+.....................+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

[custom-init] No custom files found, skipping... guacd[204]: INFO: Guacamole proxy daemon (guacd) version 1.1.0 started guacd[204]: INFO: Listening on host 0.0.0.0, port 4822 guacd[204]: INFO: Guacamole connection closed during handshake Starting guacamole-lite websocket server listening on *:3000 [guac-init] Auto start not set, application start on login [ls.io-init] done. [2023-05-22 20:29:49] [Connection 1] Client connection open [2023-05-22 20:29:49] [Connection 1] Opening guacd connection [2023-05-22 20:29:49] [Connection 1] guacd connection open [2023-05-22 20:29:49] [Connection 1] Selecting connection type: rdp [2023-05-22 20:29:49] [Connection 1] Sending opCode: 6.select,3.rdp; guacd[204]: INFO: Creating new client for protocol "rdp" guacd[204]: INFO: Connection ID is "$297ba1d3-d975-4b02-bcdd-23ab7e02ec4d" [2023-05-22 20:29:50] [Connection 1] Sending opCode: 4.size,4.1494,13.783?undefined,2.96; [2023-05-22 20:29:50] [Connection 1] Sending opCode: 5.audio,9.audio/L16; [2023-05-22 20:29:50] [Connection 1] Sending opCode: 5.video; [2023-05-22 20:29:50] [Connection 1] Sending opCode: 5.image; [2023-05-22 20:29:50] [Connection 1] Server sent handshake: 4.args,13.VERSION_1_1_0,8.hostname,4.port,6.domain,8.username,8.password,5.width,6.height,3.dpi,15.initial-program,11.color-depth,13.disable-audio,15.enable-printing,12.printer-name,12.enable-drive,10.drive-name,10.drive-path,17.create-drive-path,7.console,13.console-audio,13.server-layout,8.security,11.ignore-cert,12.disable-auth,10.remote-app,14.remote-app-dir,15.remote-app-args,15.static-channels,11.client-name,16.enable-wallpaper,14.enable-theming,21.enable-font-smoothing,23.enable-full-window-drag,26.enable-desktop-composition,22.enable-menu-animations,22.disable-bitmap-caching,25.disable-offscreen-caching,21.disable-glyph-caching,16.preconnection-id,18.preconnection-blob,8.timezone,14.recording-path,14.recording-name,24.recording-exclude-output,23.recording-exclude-mouse,22.recording-include-keys,21.create-recording-path,13.resize-method,18.enable-audio-input,9.read-only,16.gateway-hostname,12.gateway-port,14.gateway-domain,16.gateway-username,16.gateway-password,17.load-balance-info [2023-05-22 20:29:50] [Connection 1] Sending opCode: 7.connect,0.,9.127.0.0.1,4.3389,0.,0.,0.,4.1494,13.783?undefined,2.96,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,12.en-us-qwerty,3.any,4.true,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,14.display-update,0.,0.,0.,0.,0.,0.,0.,0.; guacd[291]: INFO: Security mode: Negotiate (ANY) guacd[291]: INFO: Resize method: display-update guacd[291]: INFO: User "@a2d1b346-6c3d-44f3-b094-1fa303ae8a75" joined connection "$297ba1d3-d975-4b02-bcdd-23ab7e02ec4d" (1 users now present) guacd[291]: INFO: Loading keymap "base" guacd[291]: INFO: Loading keymap "en-us-qwerty" xauth: file .Xauthority does not exist

X.Org X Server 1.21.1.3 X Protocol Version 11, Revision 0 Current Operating System: Linux a152af509f43 3.10.108 #42962 SMP Fri Mar 24 00:28:41 CST 2023 x86_64 Kernel command line: root=/dev/md0 ihd_num=0 netif_num=4 pci_sata_cache=000000010 sata_remap="2>9:3>4:4>3:5>2:6>8:8>6:9>5" syno_usb_vbus_gpio="54@0000:00:16.0@-1" syno_hw_version=DS1817+ macs=00113284237c,00113284237d,00113284237e,00113284237f sn=17B0PWN308300 xorg-server 2:21.1.3-2ubuntu2.5 (For technical support please see http://www.ubuntu.com/support) Current version of pixman: 0.40.0 Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (++) Log file: ".xorgxrdp.10.log", Time: Mon May 22 20:30:02 2023 (++) Using config file: "/etc/X11/xrdp/xorg.conf" (==) Using system config directory "/usr/share/X11/xorg.conf.d" xorgxrdpSetup: xrdpdevSetup: rdpmousePlug: rdpkeybPlug: rdpIdentify: rdpDriverFunc: op 10 rdpProbe: rdpProbe: found DRMDevice xorg.conf value [/dev/dri/renderD128] rdpProbe: found DRI3 xorg.conf value [1] rdpPreInit: rdpPreInit: /dev/dri/renderD128 open failed rdpScreenInit: virtualX 800 virtualY 600 rgbBits 8 depth 24 rdpScreenInit: pfbMemory bytes 1920000 rdpScreenInit: pfbMemory 0x7fa3046ba010 rdpSimdInit: assigning yuv functions rdpSimdInit: cpuid ax 1 cx 0 return ax 0x000406d8 bx 0x00100800 cx 0x43d8e3bf dx 0xbfebfbff rdpSimdInit: sse2 amd64 yuv functions assigned rdpClientConInit: disconnect idle session after [0] sec rdpClientConInit: kill disconnected [0] timeout [0] sec rdpXvInit: depth 24 rdpScreenInit: out rdpCreateScreenResources: rdpmousePreInit: drv 0x7fa305d0bb50 info 0x7fa305e65140, flags 0x0 rdpmouseControl: what 0 rdpmouseDeviceInit: rdpmouseCtrl: rdpRegisterInputCallback: type 1 proc 0x7fa304d8f3b0 rdpmouseControl: what 1 rdpmouseDeviceOn: rdpkeybPreInit: drv 0x7fa305d0d310 info 0x7fa305fef2f0, flags 0x0 rdpkeybControl: what 0 rdpkeybDeviceInit: rdpkeybChangeKeyboardControl: rdpkeybChangeKeyboardControl: autoRepeat on rdpRegisterInputCallback: type 0 proc 0x7fa304d89d50 rdpkeybControl: what 1 rdpkeybDeviceOn: rdpmouseControl: what 2 rdpmouseDeviceOff: rdpkeybControl: what 2 rdpkeybDeviceOff: rdpkeybControl: what 3 rdpkeybUnInit: drv 0x7fa305d0d310 info 0x7fa305fef2f0, flags 0x0 rdpUnregisterInputCallback: proc 0x7fa304d89d50 rdpmouseControl: what 3 rdpmouseUnInit: drv 0x7fa305d0bb50 info 0x7fa305e65140, flags 0x0 rdpUnregisterInputCallback: proc 0x7fa304d8f3b0 rdpCloseScreen: xorgxrdpDownDown: xorgxrdpDownDown: 1 rdpClientConDeinit: guacd[291]: INFO: RDP server closed connection: Manually logged off. rdpClientConDeinit: deleting file /run/xrdp/sockdir/xrdp_display_10 rdpClientConDeinit: deleting file /run/xrdp/sockdir/xrdp_disconnect_display_10 Global configuration: UseUnixSocket (derived): true

Security configuration: RestrictOutboundClipboard: false

Chansrv configuration: EnableFuseMount true FuseMountName: thinclient_drives FileMask: 077 chansrv::main: using log file [/config/.local/share/xrdp/xrdp-chansrv.10.log] (II) Server terminated successfully (0). Closing log file. guacd[291]: INFO: Internal RDP client disconnected guacd[291]: INFO: User "@a2d1b346-6c3d-44f3-b094-1fa303ae8a75" disconnected (0 users remain) guacd[291]: INFO: Last user of connection "$297ba1d3-d975-4b02-bcdd-23ab7e02ec4d" disconnected guacd[204]: INFO: Connection "$297ba1d3-d975-4b02-bcdd-23ab7e02ec4d" removed. [2023-05-22 20:30:04] [Connection 1] Closing guacd connection [2023-05-22 20:30:04] [Connection 1] Client connection closed [2023-05-22 20:30:13] [Connection 2] Client connection open [2023-05-22 20:30:13] [Connection 2] Opening guacd connection [2023-05-22 20:30:13] [Connection 2] guacd connection open [2023-05-22 20:30:13] [Connection 2] Selecting connection type: rdp [2023-05-22 20:30:13] [Connection 2] Sending opCode: 6.select,3.rdp; guacd[204]: INFO: Creating new client for protocol "rdp" guacd[204]: INFO: Connection ID is "$e370b7e5-d3ca-4310-9ef5-edc9babf0804" [2023-05-22 20:30:13] [Connection 2] Sending opCode: 4.size,4.1494,13.783?undefined,2.96; [2023-05-22 20:30:13] [Connection 2] Sending opCode: 5.audio,9.audio/L16; [2023-05-22 20:30:13] [Connection 2] Sending opCode: 5.video; [2023-05-22 20:30:13] [Connection 2] Sending opCode: 5.image; [2023-05-22 20:30:13] [Connection 2] Server sent handshake: 4.args,13.VERSION_1_1_0,8.hostname,4.port,6.domain,8.username,8.password,5.width,6.height,3.dpi,15.initial-program,11.color-depth,13.disable-audio,15.enable-printing,12.printer-name,12.enable-drive,10.drive-name,10.drive-path,17.create-drive-path,7.console,13.console-audio,13.server-layout,8.security,11.ignore-cert,12.disable-auth,10.remote-app,14.remote-app-dir,15.remote-app-args,15.static-channels,11.client-name,16.enable-wallpaper,14.enable-theming,21.enable-font-smoothing,23.enable-full-window-drag,26.enable-desktop-composition,22.enable-menu-animations,22.disable-bitmap-caching,25.disable-offscreen-caching,21.disable-glyph-caching,16.preconnection-id,18.preconnection-blob,8.timezone,14.recording-path,14.recording-name,24.recording-exclude-output,23.recording-exclude-mouse,22.recording-include-keys,21.create-recording-path,13.resize-method,18.enable-audio-input,9.read-only,16.gateway-hostname,12.gateway-port,14.gateway-domain,16.gateway-username,16.gateway-password,17.load-balance-info [2023-05-22 20:30:13] [Connection 2] Sending opCode: 7.connect,0.,9.127.0.0.1,4.3389,0.,0.,0.,4.1494,13.783?undefined,2.96,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,12.en-us-qwerty,3.any,4.true,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,14.display-update,0.,0.,0.,0.,0.,0.,0.,0.; guacd[344]: INFO: Security mode: Negotiate (ANY) guacd[344]: INFO: Resize method: display-update guacd[344]: INFO: User "@0be1c8a2-3e7d-4858-bf95-789cb7b3549f" joined connection "$e370b7e5-d3ca-4310-9ef5-edc9babf0804" (1 users now present) guacd[344]: INFO: Loading keymap "base" guacd[344]: INFO: Loading keymap "en-us-qwerty" guacd[344]: INFO: User "@0be1c8a2-3e7d-4858-bf95-789cb7b3549f" disconnected (0 users remain) guacd[344]: INFO: Last user of connection "$e370b7e5-d3ca-4310-9ef5-edc9babf0804" disconnected [2023-05-22 20:30:14] [Connection 2] Closing connection with error: Error: not opened at WebSocket.send (/gclient/node_modules/ws/lib/WebSocket.js:218:38) at ClientConnection.send (/gclient/node_modules/guacamole-lite/lib/ClientConnection.js:125:24) at GuacdClient.sendBufferToWebSocket (/gclient/node_modules/guacamole-lite/lib/GuacdClient.js:172:35) at GuacdClient.processReceivedData (/gclient/node_modules/guacamole-lite/lib/GuacdClient.js:163:14) at Socket.emit (node:events:513:28) at addChunk (node:internal/streams/readable:315:12) at readableAddChunk (node:internal/streams/readable:289:9) at Socket.Readable.push (node:internal/streams/readable:228:10) at TCP.onStreamRead (node:internal/stream_base_commons:190:23) [2023-05-22 20:30:14] [Connection 2] Closing guacd connection [2023-05-22 20:30:14] [Connection 2] Client connection closed guacd[344]: INFO: Internal RDP client disconnected guacd[204]: INFO: Connection "$e370b7e5-d3ca-4310-9ef5-edc9babf0804" removed. Global configuration: UseUnixSocket (derived): true

Security configuration: RestrictOutboundClipboard: false

Chansrv configuration: EnableFuseMount true FuseMountName: thinclient_drives FileMask: 077 chansrv::main: using log file [/config/.local/share/xrdp/xrdp-chansrv.10.log]

northsea4 commented 1 year ago

试一下用web方式是否可以连接桌面

iian commented 1 year ago

登录界面 image 登录后 image

rdpCloseScreen: xorgxrdpDownDown: xorgxrdpDownDown: 1 rdpClientConDeinit: rdpClientConDeinit: disconnecting clientCon rdpClientConDisconnect: rdpRemoveClientConFromDev: removing clientCon 0x7f3666f8f300 rdpClientConDeinit: deleting file /run/xrdp/sockdir/xrdp_display_10 rdpClientConDeinit: deleting file /run/xrdp/sockdir/xrdp_disconnect_display_10 (II) Server terminated successfully (0). Closing log file. guacd[232]: INFO: RDP server closed connection: Manually logged off. guacd[232]: INFO: Internal RDP client disconnected guacd[232]: INFO: User "@a6afa5b2-7ed3-40bd-b0a2-b8fc28e3c9b7" disconnected (0 users remain) guacd[232]: INFO: Last user of connection "$2da79d1e-c7dd-4b30-bb07-b1af71eba1e7" disconnected guacd[181]: INFO: Connection "$2da79d1e-c7dd-4b30-bb07-b1af71eba1e7" removed. [2023-05-22 21:07:07] [Connection 1] Closing guacd connection [2023-05-22 21:07:07] [Connection 1] Client connection closed

iian commented 1 year ago

测试了官方的webtop镜像,linuxserver/webtop:latest,web访问可以进入桌面。 image

northsea4 commented 1 year ago

linuxserver/webtop 有不少桌面环境,linuxserver/webtop:latest 的是xfce,我们这个则是 kde

northsea4 commented 1 year ago

对于看不到桌面的问题,可以参考这个 issue

docker-compose.yml里可以这么写:

version: '3'

services:
  mdcx:
    image: xxx
    container_name: xxx
    security_opt:
      - seccomp:unconfined
iian commented 1 year ago

linuxserver/webtop 有不少桌面环境,linuxserver/webtop:latest 的是xfce,我们这个则是 kde

更换了linuxserver/webtop:ubuntu-kde,进不去桌面,也是类似的报错

image

kwriteconfig5: error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory

iian commented 1 year ago

对于看不到桌面的问题,可以参考这个 issue

docker-compose.yml里可以这么写:

version: '3'

services:
  mdcx:
    image: xxx
    container_name: xxx
    security_opt:
      - seccomp:unconfined

也不行

northsea4 commented 1 year ago

基于webtop的镜像不能查看桌面的问题,暂时没头绪。

对于 error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory 这个问题,暂时可以这么尝试。 首先,要使用mdcx-src-gui-base,也就是源码版,因为源码版的镜像才有 /usr/lib/aarch64-linux-gnu/libQt5Core.so.5 。 而builtin版(即编译版)的libQt5Core.so.5文件是在应用运行时才释放到/tmp/[随机目录名]下面的。 步骤如下:

  1. 在部署目录/path/to/mdcx-docker下创建一个strip.sh文件
    touch strip.sh && chmod +x strip.sh
  2. 编辑strip.sh文件,输入以下内容并保存
    
    #!/bin/bash

echo "=========================😁 strip libQt5Core 😁=============================="

ARCH=$(uname -m) QT5CORE_PATH="/usr/lib/$ARCH-linux-gnu/libQt5Core.so.5" QT5CORE_PATH_BAK="/home/libQt5Core.so.5.bak" if [ ! -f "$QT5CORE_PATH" ]; then echo "❌ $QT5CORE_PATH 不存在!" else if [ ! -f "$QT5CORE_PATH_BAK" ]; then cp $QT5CORE_PATH $QT5CORE_PATH_BAK strip --remove-section=.note.ABI-tag $QT5CORE_PATH echo "🔧 已对 $QT5CORE_PATH 进行strip处理" echo "🔧 备份文件路径: $QT5CORE_PATH_BAK" else echo "🔧 $QT5CORE_PATH 已经备份过了,跳过strip处理" fi fi

3. 把`strip.sh`映射到容器系统的初始化目录
```yml
volumes:
  - ./strip.sh:/etc/cont-init.d/251-strip.sh
  1. 重建容器
    docker-compose up -d

    5.测试

northsea4 commented 1 year ago

@iian 对了,使用latest这个tag,不要用latest-dev

iian commented 1 year ago

基于webtop的镜像不能查看桌面的问题,暂时没头绪。

对于 error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory 这个问题,暂时可以这么尝试。 首先,要使用mdcx-src-gui-base,也就是源码版,因为源码版的镜像才有 /usr/lib/aarch64-linux-gnu/libQt5Core.so.5 。 而builtin版(即编译版)的libQt5Core.so.5文件是在应用运行时才释放到/tmp/[随机目录名]下面的。 步骤如下:

  1. 在部署目录/path/to/mdcx-docker下创建一个strip.sh文件
touch strip.sh && chmod +x strip.sh
  1. 编辑strip.sh文件,输入以下内容并保存
#!/bin/bash

echo "=========================😁 strip libQt5Core 😁=============================="

ARCH=$(uname -m)
QT5CORE_PATH="/usr/lib/$ARCH-linux-gnu/libQt5Core.so.5"
QT5CORE_PATH_BAK="/home/libQt5Core.so.5.bak"
if [ ! -f "$QT5CORE_PATH" ]; then
  echo "❌ $QT5CORE_PATH 不存在!"
else
  if [ ! -f "$QT5CORE_PATH_BAK" ]; then
    cp $QT5CORE_PATH $QT5CORE_PATH_BAK
    strip --remove-section=.note.ABI-tag $QT5CORE_PATH
    echo "🔧 已对 $QT5CORE_PATH 进行strip处理"
    echo "🔧 备份文件路径: $QT5CORE_PATH_BAK"
  else
    echo "🔧 $QT5CORE_PATH 已经备份过了,跳过strip处理"
  fi
fi
  1. strip.sh映射到容器系统的初始化目录
volumes:
  - ./strip.sh:/etc/cont-init.d/251-strip.sh
  1. 重建容器
docker-compose up -d

5.测试

解决问题了,mdcx-src-gui-base可以使用,mdcx-src-webtop-base也可以进入桌面。

northsea4 commented 1 year ago

mdcx-src-webtop-base是做了什么处理吗?

iian commented 1 year ago

mdcx-src-webtop-base 也是增加了您提供的strip.sh这个脚本,解决了进入桌面的问题。

northsea4 commented 1 year ago

👍🏻好的明白了。

libQt5Core.so 还会影响进入webtop桌面,这点我之前觉得可能性很低,因为考虑到这个库文件是在运行MDCx应用时才动态加载的,而MDCx应用在webtop环境是需要手动运行的。

到时候我会把这个strip.sh脚本内置到镜像。

northsea4 commented 1 year ago

strip脚本已内置到容器,但需要指定相关的环境变量才能启用strip处理。

修改.env文件,STRIP_LIBQT5CORE设置为true

# 是否对`libQt5Core.so.5`进行strip处理,数值为true/false,默认false。
# 请注意:该设置只适用于源码版镜像(mdcx-src-gui-base,mdcx-src-webtop-base)
STRIP_LIBQT5CORE=true