mviereck / x11docker

Run GUI applications and desktops in docker and podman containers. Focus on security.
MIT License
5.62k stars 378 forks source link

X apps with native wayland desktop (GNOME + mutter) #96

Closed sandrokeil closed 5 years ago

sandrokeil commented 5 years ago

Again, thank you very much for this project. I use it on a day by day basis, over a year and it works flawlessly. I installed Arch Linux with GNOME and the X dependencies and weston and mutter (GNOME wayland window manager) on my notebook (Lenovo W510) and now I can test wayland sessions because I don't use proprietary NVIDIA drivers.

I try to run Chromium with GPU support but it doesn't work well in this case. Did I miss something or should I use another start option? There are some interesting messages in the log file x11docker.log

Did not find a nice solution to run a seamless application with option --gpu

I have installed weston, Xwayland and xdotool.

Could not detect a host window manager

Can you add support for mutter too?

mviereck commented 5 years ago

I use it on a day by day basis, over a year and it works flawlessly.

Glad to hear that. :-) Thank you for your blog post about x11docker!

I try to run Chromium with GPU support but it doesn't work well in this case.

Did it start up at all? Or what else did not work well? The error messages seem to be DBus related. They might get away with --dbus-system or --systemd.

I have installed weston, Xwayland and xdotool.

If you also install xpra you get seamless windows instead of a Weston window. You can also use --hostdisplay. I thought x11docker would use it automatically with --gpu if xpra is missing. I'll look at that.

Can you add support for mutter too?

I once removed mutter because it segfaults quite often. I did a test again yet and it did not crash. Maybe something was fixed in the meantime. I can add it again. However, in my test it resized a Xephyr window up to unusable size so I still cannot recommend it. For a first test you can set --wm mutter.


For applications that support wayland you can try --wayland or --hostwayland. Note that x11docker does not choose them automatically. Also note that most applications in Gnome-Wayland still run on X / Xwayland.

sandrokeil commented 5 years ago

Thank you for your blog post about x11docker!

You're welcome!

I thought that I don't need xpra for wayland or xwayland apps. --wm mutter works and it uses weston-xwayland.

If I use --xpra-xwayland it produces GetVSyncParametersIfAvailable errors. This looks like Chromium related. If I installed libglvnd additionally in the Chromium container this error goes away but the container doesn't start anymore. The start command is wrong Running image command: /x11docker/tini -- /usr/local/bin/start --ignore-gpu-blacklist --enable-native-gpu-memory-buffers --enable-features=VizDisplayCompositor --force-gpu-rasterization --enable-checker-imaging.

Do you have any idea why this happened? There is some EGL log output at line 837. See x11docker.log

mviereck commented 5 years ago

I thought that I don't need xpra for wayland or xwayland apps.

You would not need it for --hostwayland (that I consider to be safe), but that works only for applications that support Wayland. For Xwayland it is the same as with Xorg; you can use insecure --hostdisplay or have to use other X servers with e.g. --xpra to avoid X security leaks.

The start command is wrong

There seems to be an issue in your start script:

/usr/local/bin/start: line 3: exec: --: invalid option
exec: usage: exec [-cl] [-a name] [command [arguments ...]] [redirection ...]

Check which command it produces. Check also whether x11docker submits the correct arguments to your script. I'm not sure at which point this goes wrong. Maybe show me /usr/local/bin/start. Does it work without all arguments? I assume it is a wrapper for chromium doing some setup.

There is some EGL log output at line 837.

This output is from Weston that runs invisible in background. It shows a few warnings, but looks ok overall.

sandrokeil commented 5 years ago

I'm going to close this now, because I think it has nothing to do with x11docker. The exec error was on my site. Maybe I have to install some other packages or chromium works only with --hostdisplay. It looks vlc works so far.

mviereck commented 5 years ago

I did a test yet with jess/chromium. So far I found:

sandrokeil commented 5 years ago

I have same sandbox issue with jess/chromium but --cap-default --sys-admin works with my own Arch Linux Chromium Docker image. Maybe it's Debian related.

The libglvnd package, which is included in mesa does not solve my problems or it has no hardware acceleration. What is the output of chrome://gpu if you use --xpra --gpu? Compare it with --hostdisplay. As I said, maybe this is only a Chromium issue, because vlc works (but I have some warnings).

mviereck commented 5 years ago

jess/chromium without libglvnd:

With --xpra --gpu it is terribly slow. With --hostdisplay --gpu the speed is ok. Output of both is the same at the top, did not compare the rest yet:

Graphics Feature Status
Canvas: Hardware accelerated
Flash: Hardware accelerated
Flash Stage3D: Hardware accelerated
Flash Stage3D Baseline profile: Hardware accelerated
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
Native GpuMemoryBuffers: Software only. Hardware acceleration disabled
Out-of-process Rasterization: Disabled
Hardware Protected Video Decode: Hardware accelerated
Rasterization: Software only. Hardware acceleration disabled
Skia Deferred Display List: Disabled
Skia Renderer: Disabled
Surface Control: Disabled
Surface Synchronization: Enabled
Video Decode: Hardware accelerated
Viz Service Display Compositor: Disabled
WebGL: Hardware accelerated
WebGL2: Hardware accelerated

Firefox with x11docker --xpra --gpu jess/firefox runs well. --xpra --gpu is always a bit slower than --hostdisplay --gpu as it has to transfer the window content. Aside from that it has no obvious disadvantages.

jess/chromium runs with reasonable speed in --weston-xwayland --gpu. I have no idea why xpra makes a difference here. The X server setup (weston+Xwayland) is the same for both options.

Can you add support for mutter too?

I have added mutter to the window manager list. A warning about malfunctions will be shown.

sandrokeil commented 5 years ago

With --xpra --gpu it is terribly slow. With --hostdisplay --gpu the speed is ok

Same here. The --xpra option uses --xpra-xwayland on my system. The slow speed comes from the Chromium GetVSyncParametersIfAvailable errors. To enable more hardware acceleration I use the Chromium options: --ignore-gpu-blacklist --enable-native-gpu-memory-buffers --enable-features=VizDisplayCompositor --force-gpu-rasterization --enable-checker-imaging. The option --ignore-gpu-blacklist is necessary for me, otherwise I don't have hardware acceleration at all. To display FPS you can add the option --show-fps-counter.

It looks like vlc has no hardware acceleration on my system. I think I have to setup VDPAU too. It was easier with NVIDIA. ;-)

mviereck commented 5 years ago

It looks like vlc has no hardware acceleration on my system.

You might need to change settings in Einstellungen->Video->Ausgabe VLC likes to complain about vdpau even if the issue is somewhere else.