SUMMARY I want to be able to dynamically start and stop Xwayland. It's helpful for multi GPU VM passthrough since xwayland seems to holds onto my secondary GPU. If Xwayland could be dynamically started and stopped, I would be able to: 1. Run wayland with Xwayland for X11 only apps 2. Stop Xwayland when I start up my GPU passthrough VM 3. Start Xwayland again so that it only uses the GPU which hasn't been passed though to my VM 4. When I stop my VM, I can restart Xwayland again and Xwayland can use both GPUs now 5. All of the above without having to restart kde plasma/kwin_wayland It might also help with optimus on laptops here: https://discuss.kde.org/t/is-there-any-way-to-restart-xwayland-without-closing-session-and-restarting-kwin-wayland/1741 Currently, I have removed the --xwayland option for kwin_wayland_wrapper but this means I don't have support for any X applications at all.
My other option would be to restart the plasma wayland session entirely every time I close or open my VM, but this means that I lose anything that I have opened.
Kwin already does start and stop xwayland automatically regardless of that flag depending on whether an X11 app connects. Unfortunately right now some we have some X11 apps on startup. You could identify and mask them for now. We intend to make those components load on demand when the first real app starts later. This will happen at some point, probably ~6.2 >It's helpful for multi GPU VM passthrough since xwayland seems to holds onto my secondary GPU. This sounds like you're working round a bug. Report to Xwayland and get that fixed.
> Kwin already does start and stop xwayland automatically regardless of that > flag depending on whether an X11 app connects. So when xlsclients shows nothing it Xwayland should stop running? I've just checked now and it doesn't seem to work this way. $ kwin_wayland --version kwin 6.0.2 > This sounds like you're working round a bug. Report to Xwayland and get that fixed. Ok, I'll go try that.