** Description changed: + [ Impact ] + + * Applications that require XDG desktop portals that are provided by + xdg-desktop-portal-kde do not function in Kubuntu's live session. Among + these applications are Zoho Connect, which requires the Screencast + portal. This is used by at least one Linux laptop vendor (Kubuntu Focus) + for providing remote support for customers, thus this bug greatly + complicates remotely assisting OS reinstallations. + + * This is because xdg-desktop-portal.service is starting too early + (while the Try/Install screen is presented, before Plasma starts). + + * Restarting xdg-desktop-portal.service after Plasma startup resolves + the issue. This patch drops an autostart desktop file to do that. + + [ Test Plan ] + + * Boot the Kubuntu 26.04 LTS ISO in single-user mode, by pressing `e` on the GRUB screen and adding the `single` parameter to the end of the `linux` line. + * Enable networking and connect to a network. + * Run `sudo apt install cmake build-essential extra-cmake-modules libgstreamer1.0-dev wayland-protocols qt6-base-dev libkf6i18n-dev libkf6kio-dev libkf6notifications-dev libkf6windowsystem-dev` to install the dependencies of the XDG portal test. (This list of dependencies may be incomplete and will be updated if needed.) + * Enable the resolute-proposed repository. + * Upgrade kubuntu-installer-prompt from -proposed. + * Exit the root shell of single-user mode, to allow a normal live ISO boot to finish. + * When the Try/Install screen is presented, click "Try Kubuntu". + * Clone KDE's XDG portal test: `git clone https://invent.kde.org/libraries/xdg-portal-test-kde.git` + * Build it: `cd xdg-portal-test-kde && mkdir build && cd build && cmake .. && make` + * Run it: `bin/xdg-portal-test-kde` + * Scroll down to "Screen sharing" and click "Request". Confirm that a window appears for selecting which screen you want to "share". (This will use the Screencast portal, which will ensure that xdg-desktop-portal-kde is running.) + * Click various other buttons in the UI, ensure they behave as expected. If any buttons do not behave as expected, test that button of the app on a full Kubuntu 26.04 LTS installation and ensure the failure you saw occurs there too. + * Run `systemctl --user status xdg-desktop-portal.service`. Ensure the service is running and the logs do not contain a large number of messages about falling back to the GTK portal implementation. + * Run `systemctl --user status xdg-desktop-portal-gtk.service` (yes, gtk, not kde yet). Ensure the service is running. + * Run `systemctl --user status xdg-desktop-portal-kde.service`. Ensure the service is running. + * Repeat the above test on at least three hardware platforms (ideally one very fast machine, one slower machine, and a virtual machine). + + [ Where problems could occur ] + + * Anything that could go wrong from restarting xdg-desktop- + portal.service could go wrong here. In particular, if some conditions + can result in xdg-desktop-portal.service crashing on restart, and those + conditions are met when the automatic restart is attempted, all portals + (not just those that are provided only by xdg-desktop-portal-kde) could + break. + + [ Other Info ] + + * See the original bug report for lots of gory details. + + * The test plan should ensure this SRU causes no issues. If it lands in + -updates in time for the 26.04.1 release, it will gets lots of testing + as part of usual ISO testing. + + ----- + + Original bug report: + In Kubuntu 26.04 LTS, if you boot from a live ISO and click "Try Kubuntu", you get what looks like a fully functional Plasma session. However, if you try to use a tool that requires an XDG desktop portal that only xdg-desktop-portal-kde provides, such as a remote desktop agent for sharing your live session with someone else, the application will fail in various ways (error messages in logs and silent failure are common symptoms). As it turns out, xdg-desktop-portal-kde is not being started or used; `systemctl --user status plasma-xdg-desktop-portal- kde.service` will report that the service is inactive, while `systemctl --user status xdg-desktop-portal.service` will show that lots of things are falling back to the GTK desktop portal. A real-world application that breaks because of this is Zoho Assist, but the "screen capture" button in KDE's XDG portal test (https://invent.kde.org/libraries/xdg- portal-test-kde) can also be used. Steps to reproduce: 1. Boot a Kubuntu 26.04 LTS ISO in a VM with at least 8 GB RAM. 2. Run `sudo apt install cmake build-essential extra-cmake-modules libgstreamer1.0-dev wayland-protocols qt6-base-dev libkf6i18n-dev libkf6kio-dev libkf6notifications-dev libkf6windowsystem-dev` to install the dependencies of the XDG portal test linked above. (NOTE: This list might be incomplete.) 3. Clone the portal test: `git clone https://invent.kde.org/libraries/xdg-portal-test-kde.git` 4. Build it: `cd xdg-portal-test-kde && mkdir build && cd build && cmake .. && make` 5. Run it: `bin/xdg-portal-test-kde` 6. Click the screen recording button (don't remember what it's called now as I'm not looking at the window) Expected result: A window pops up asking you which screen or window you would like to "share". Actual result: An error message is printed in the console about the Screencast portal not being available, and no screen sharing window appears. The reason this happens appears to be that xdg-desktop-portal.service starts *before* Plasma when using the kubuntu-live-environment session. The environment loaded into the systemd user manager at that point doesn't tell xdg-desktop-portal that it is running under a KDE-based desktop, so xdg-desktop-portal falls back to the GTK portal instead. Restarting `xdg-desktop-portal.service` after Plasma has fully started fixes this; something that gets triggered by `startplasma-wayland` is most likely loading more environment variables into the systemd user manager, so once `xdg-desktop-portal.service` is restarted, it sees that it's running under a KDE-based desktop and picks the right portal provider. I haven't been able to find a particularly clean way of fixing this, but one working solution is to adjust the `start-kubuntu-live-env` script to drop a file at `$HOME/.config/autostart/portal-fix.desktop` that runs `systemctl --user restart xdg-desktop-portal.service`. This gets executed after Plasma starts, and fixes the portal.
-- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2164684 Title: xdg-desktop-portal-kde isn't being used in the live session To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/kubuntu-installer-prompt/+bug/2164684/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
