简体   繁体   English

尝试通过 x11 连接在容器中运行 Tauri 应用程序时出现 WebKitWebProcess / Gdk 错误

[英]WebKitWebProcess / Gdk-Error when trying to run a Tauri app in a container via x11 connection

I'm trying to display a basic Tauri app GUI running in a Docker container but connected to the host's X11 server through a unix socket.我正在尝试显示在 Docker 容器中运行但通过 unix 套接字连接到主机的 X11 服务器的基本 Tauri 应用程序 GUI。 But I get the following warning and error when running npm run tauri dev :但是在运行npm run tauri dev时,我收到以下警告和错误:

(WebKitWebProcess:6009): Gdk-ERROR **: 00:17:37.147: The program 'WebKitWebProcess' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadValue (integer parameter out of range for operation)'.
  (Details: serial 258 error_code 2 request_code 152 (GLX) minor_code 34)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

I get opened a GUI window on the host but it's blank (but should contain some text / HTML markup).我在主机上打开了一个 GUI window,但它是空白的(但应该包含一些文本/HTML 标记)。

As I am able to get Firefox and Gedit running from within the container but not the gnome-terminal, I think it's some permissions issue or there is some missing package to get the Webkit based GUI window connecting to my host's X server.因为我能够从容器中运行 Firefox 和 Gedit 而不是 gnome 终端,我认为这是一些权限问题或者缺少一些 package 来获得基于 Webkit 的 GUI window 连接到我主机的 X 服务器。 $DISPLAY and /tmp/.X11-unix are set properly. $DISPLAY/tmp/.X11-unix设置正确。 On the host I set xhost +在我设置的主机上xhost +

The container is running as node user.容器以node用户身份运行。 Cargo is installed in /home/node/.cargo/bin . Cargo 安装在/home/node/.cargo/bin中。 /home/node is owned by root:node with 775 permissions on folders and 664 on files ( +x on executable scripts). /home/noderoot:node拥有,对文件夹有775个权限,对文件有664个权限( +x对可执行脚本)。

I'm just getting started with Rust and Tauri and also not a big expert on X server and Docker.networking.我刚刚开始使用 Rust 和 Tauri,也不是 X 服务器和 Docker.networking 方面的大专家。

Any ideas how to get it work?任何想法如何让它工作?

I ended up using Qemu + Virt-Manager instead of docker. For the starters I've used an Ubuntu template as the clipboard sharing works out of the box with my host running on Ubuntu as well.我最终使用 Qemu + Virt-Manager 而不是 docker。对于初学者,我使用了 Ubuntu 模板,因为剪贴板共享开箱即用,我的主机也在 Ubuntu 上运行。 Sound sharing and video playback works out of the box, too.声音共享和视频播放也开箱即用。 And if I should get in the situation where I would need a separate VM for each app, then I would use my minimalist Arch template to spin up the VM's - the size should be pretty close to that of a docker container.如果我遇到每个应用程序都需要一个单独的 VM 的情况,那么我会使用我的极简主义 Arch 模板来启动 VM - 大小应该非常接近 docker 容器的大小。

Edit: LXC/LXD and Podman might be even better alternatives, I have been told.编辑:有人告诉我,LXC/LXD 和 Podman 可能是更好的选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM