
On 8/5/22 15:15, Andrei Borzenkov wrote:
On 05.08.2022 01:09, Larry Finger wrote:
Hi,
I have run into a problem using VirtualBox with Wayland-based guests. The script that enables clipboard sharing and screen resizing under X11 uses a system service script; however for Wayland graphics, the appropriate commands cannot be run until the user logs in.
I do not know how to create a user-based service, nor do I know where to place a script so that it will be run for every user that logs in.
E-h-h ... https://bugzilla.opensuse.org/show_bug.cgi?id=1194126
Any help will be appreciated.
Well, there are two options
1. Starting as user service. The problem is to arrange start of this service after Wayland compositor is fully functional and Xwayland (at least $DISPLAY) is actually available. GNOME has graphical-session.target, so ordering this service after it worked in my testing. KDE does not (yet?) use systemd to manage session processes, so for KDE something else is needed.
2. Use normal XDG autostart facilities that should work in any DE. For this just place desktop file in /etc/xdg/autostart. I do not know whether there is any condition to restrict it only to Wayland environment. Note that autostart will be processed both for X11 and Wayland, which may conflict with xinit script (I do not know if VB service is smart enough to notice it is already running). Moving startup from xinit to autostart means it will stop working for bare minimal X11 environment without any fancy desktop.
It would be simple enough to detect a straight X11 session and bail (for example $DISPLAY will be set and $WAYLAND_DISPLAY will not. As long as its well documented that people using xinit may need extra steps and what those steps are having it stop working there by default is probably ok. These days any user experienced enough to still be needing xinit should have the technical skills to make any required adjustments. These days there are plenty of things that assume a systemd user session will have been started because ligthdm, gdm and sddm all handle this. -- Simon Lees (Simotek) http://simotek.net Emergency Update Team keybase.io/simotek SUSE Linux Adelaide Australia, UTC+10:30 GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B