我想做的是拥有
- 一个容器(最好是 OCI 容器),它可以在没有主机会话管理器接口“暴露”它的情况下工作,并且
- 运行一个 Wayland 合成器
- 有一个 >= gnome40 会话,包括其中的所有 UI 元素
- 允许通过 RDP 或 VNC 进行远程显示和交互
因此,这分别指示/建议作为工具:
podman
mutter
(正如 Gnome 想要的那样)gnome-shell
gnome-remote-desktop
, Gnome42 自带的
我目前正在做的是
podman run -it --rm -p 9999:9999 ubuntu:22.04
# ^---------------------------------Interactive
# ^-----------------------------Don't keep state after finishing
# ^------------------------We'll need a port fwd into the container for RDP/VNC
# ^------------Not a great fan of Canonical, but 22.04 brings Gnome42
root@container$> apt update; apt install -y mutter gnome-remote-desktop gnome-shell
[… [success]]
root@container$> mutter --no-x11 --wayland --headless --virtual-monitor 1600x1000
mutter-Message: 10:30:35.151: Running Mutter (using mutter 42.0) as a Wayland display server
mutter-Message: 10:30:35.191: Created surfaceless renderer without GPU
mutter-Message: 10:30:35.205: Disabling DMA buffer screen sharing (not hardware accelerated)
mutter-Message: 10:30:35.205: Added virtual monitor Meta-0
(mutter:13413): mutter-WARNING **: 10:30:35.211: WL: error: XDG_RUNTIME_DIR not set in the environment
(mutter:13413): mutter-ERROR **: 10:30:35.211: Failed to create socket
root@container$> export XDG_RUNTIME_DIR=/run/user/0/ ; mkdir -p ${XDG_RUNTIME_DIR}
root@container$> mutter --no-x11 --wayland --headless --virtual-monitor 1600x1000
mutter-Message: 10:30:47.657: Running Mutter (using mutter 42.0) as a Wayland display server
mutter-Message: 10:30:47.698: Created surfaceless renderer without GPU
mutter-Message: 10:30:47.712: Disabling DMA buffer screen sharing (not hardware accelerated)
mutter-Message: 10:30:47.712: Added virtual monitor Meta-0
mutter-Message: 10:30:47.717: Using Wayland display name 'wayland-0'
**
mutter:ERROR:../src/wayland/meta-wayland.c:379:set_gnome_env: assertion failed: (session_bus)
Bail out! mutter:ERROR:../src/wayland/meta-wayland.c:379:set_gnome_env: assertion failed: (session_bus)
[1]+ Aborted (core dumped) mutter --sm-disable --no-x11 --wayland --headless --virtual-monitor 1600x1000
不太确定从这里去哪里。我应该直接启动一个 gnome shell 吗?
# fresh container to avoid any conflicts
root@7396d1bb8693:/> gnome-shell --no-x11 --wayland --headless --virtual-monitor 1600x1000
mutter-Message: 10:45:06.276: Running GNOME Shell (using mutter 42.0) as a Wayland display server
mutter-Message: 10:45:06.323: Created surfaceless renderer without GPU
mutter-Message: 10:45:06.337: Disabling DMA buffer screen sharing (not hardware accelerated)
mutter-Message: 10:45:06.338: Added virtual monitor Meta-0
Failed to connect to session bus: Cannot autolaunch D-Bus without X11 $DISPLAYroot@7396d1bb8693:/>
也不行。
- 如何在非特权容器中启动无头 gnome wayland 会话?
到目前为止,用户 dbus 的启动和自动检测似乎在非特权容器中不起作用。出于这个原因,你不能做你想做的事。您需要一个实际的 loginctl 用户会话才能使 Wayland 自动检测工作。