cage-kiosk/cage

No window controls in WSL2

Opened this issue · 6 comments

Hi, I am trying to run Waydroid under WSL2 and got it to work... Mostly.

I did:

  1. Compile my own kernel with the additional modules enabled
  2. Modified Waydroid to work in a VM
  3. Used https://github.com/viruscamp/wslg-links to solve Wayland references issues

I am able to get Cage to work and render the Waydroid image, however it is missing window decoration and thus I am unable to resize the window or move it at all.

I am open to provide additional logs and test stuff.

The OS I use is Arch WSL, however I have the same issue in Ubuntu 24.04 WSL.

Hello. When you mention "however it is missing window decoration" do you mean decorations of the window within cage?

Hi, no, I mean of cage itself.
When I e.g. run weston in kiosk mode, it does have a window frame and toolbar.

Could you check whether tinywl has its decorations shown as expected.

To run tinywl --
Setup wlroots build with meson and make it with ninja. Then, to start tinywl with an argument, you can do ./tinywl/tinywl -s <appofchoice> considering you're in the wlroots build directory.

Is cage shown in fullscreen? Perhaps this, or similar issues in the same repo, will be useful: microsoft/wslg#530

I cannot test it myself, since I don't have any machines running Microsoft windows. Good luck!

WSLg is based on Weston and this compositor does not support server-side decoration. By design, Cage does not draw client-side decoration even when used as nested compositor.
I am not sure of XWayland behavior (XWayland on top of WLSg weston) and no env to test right now. You may give it a shot unsetting WAYLAND_DISPLAY environment variable in the env you're launching Cage. Ensure DISPLAY environment variable is set.

@joggee-fr got nothing, this was the error log:

Error log (open to see)

[waydroid@TUG-GIOVANNI ~]$ _WAYLAND_DISPLAY=$WAYLAND_DISPLAY
[waydroid@TUG-GIOVANNI ~]$ unset WAYLAND_DISPLAY
[waydroid@TUG-GIOVANNI ~]$ cage -- /usr/bin/waydroid show-full-ui
00:00:00.014 [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to load driver"
libEGL warning: MESA-LOADER: egl: failed to open vgem: driver not built!

00:00:00.015 [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to load driver"
libEGL warning: failed to open /dev/dri/card0: Permission denied

00:00:00.015 [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "DRI2: failed to load driver"
00:00:00.015 [EGL] command: eglInitialize, error: EGL_NOT_INITIALIZED (0x3001), message: "eglInitialize"
00:00:00.015 [render/egl.c:268] Failed to initialize EGL
00:00:00.015 [render/egl.c:571] Failed to initialize EGL context
00:00:00.015 [render/gles2/renderer.c:499] Could not initialize EGL
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.018 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.019 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.019 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.019 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.019 [xwayland/sockets.c:96] /tmp/.X11-unix is not a directory
00:00:00.019 [xwayland/sockets.c:217] No display available in the first 33
00:00:00.019 [../cage/cage.c:535] Cannot create XWayland server
00:00:00.039 [types/output/render.c:24] output backend and allocator buffer capabilities don't match
00:00:00.039 [../cage/output.c:265] Failed to initialize output rendering
00:00:00.040 [backend/x11/backend.c:704] X11 error: op ChangeProperty (no minor), code Atom (no extension), sequence 59, value 0
[14:26:53] Starting waydroid session
[14:27:11] Android with user 0 is ready

@ItachiSan, not creating the XWayland server in Cage is not a fatal error. If you are building Cage yourself, you can also disable XWayland option (-Dwlroots:xwayland=disabled).
However, you should be able to launch an X11 client in the base environment i.e. the same you are launching Cage. Is the DISPLAY variable well set? Are you able to run a simple X11 client instead of Cage, xeyes for example. I know it works in the default WSL Ubuntu distribution.