Bug 1951580 - spice-vdagent does not start in plasma session
Summary: spice-vdagent does not start in plasma session
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: spice-vdagent
Version: 34
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
Assignee: Christophe Fergeau
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: https://fedoraproject.org/wiki/Common...
: 1928446 1948980 1981338 (view as bug list)
Depends On:
Blocks: 1951173
TreeView+ depends on / blocked
 
Reported: 2021-04-20 13:56 UTC by Germano Massullo
Modified: 2023-06-12 02:51 UTC (History)
16 users (show)

Fixed In Version: spice-vdagent-0.21.0-3.fc34
Clone Of:
Environment:
Last Closed: 2021-07-18 01:24:08 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github systemd systemd issues 18791 0 None open xdg-autostart-generator: unconditionally ignores items with X-GNOME-Autostart-Phase 2021-04-27 04:19:02 UTC

Description Germano Massullo 2021-04-20 13:56:15 UTC
Opening this bugreport upon suggestion of devs in spice-devel.org
( full discussion and logs at https://lists.freedesktop.org/archives/spice-devel/2021-April/052351.html )

spice-vdaget is broken in F34 guests, it is not running at all or it deactivates itself

https://germano.fedorapeople.org/bugreport/spice/spice_vda_fedora34kde.txt
https://germano.fedorapeople.org/bugreport/spice/spice_vda_fedora34gnome.txt

Comment 1 Germano Massullo 2021-04-20 13:56:59 UTC
*** Bug 1948980 has been marked as a duplicate of this bug. ***

Comment 2 Ben Cotton 2021-04-26 15:41:31 UTC
For what it's worth, I can replicate the behavior in comment 0 on F34 KDE. But even after starting it manually with `systemctl start spice-vdagentd.service`, the process seems to run but copy/paste still does not work as on F33 guests.

(Host is F34)

Comment 3 Adam Williamson 2021-04-26 21:43:58 UTC
I've noticed similar in KDE, but not in GNOME. I just booted the final release (RC2) Workstation live image in a virt-manager VM on an F34 host, and spice-vdagentd is running in the guest and copy/paste from a terminal in the guest to gedit in the host works OK.

Comment 4 Adam Williamson 2021-04-26 21:54:19 UTC
CCing Rex for the KDE angle here.

Comment 5 Rex Dieter 2021-04-27 04:19:06 UTC
See upstream bug
https://github.com/systemd/systemd/issues/18791

"xdg-autostart-generator: unconditionally ignores items with X-GNOME-Autostart-Phase"

Comment 6 Rex Dieter 2021-04-27 04:21:40 UTC
So suggestion is:
* either remove X-GNOME-Autostart-Phase
or
* provide systemd user service for it

Comment 7 Germano Massullo 2021-05-04 17:15:39 UTC
(workaround) Rex how can I edit systemd unit files involved in order to let spice-vdagent work in F34 KDE Plasma?

Comment 8 Marc-Andre Lureau 2021-05-04 18:42:51 UTC
If we could have the fix (or reasonable workaround) upstream too, that would be great!

Comment 9 Maxwell G 2021-05-25 18:22:30 UTC
Is there any progress on this? This bug significantly effects usage of Fedora 34 KDE in a VM, as neither the automatic resizing feature nor the clipboard sharing features work. Can we at least implement a temporary fix until the upstream bug is fixed?

Thanks,
Maxwell

Comment 10 mark preston 2021-06-19 16:24:37 UTC
not working in KDE for me.  can someone work on this please.

Comment 11 mark preston 2021-06-19 17:05:58 UTC
it isn't just copy/paste that is not working for me but also the auto-cursor release is not working.

Comment 12 mark preston 2021-07-13 21:30:02 UTC
this is in the release notes for 34 and should be addressed urgently. If i knew that it was going to take this long to get it addressed i would never have upgraded to 34.

Comment 13 Maxwell G 2021-07-14 00:51:25 UTC
Just to be clear, spice-vdagent has two parts. According to man spice-vdagent[1]:

> The spice guest agent for Linux consists of 2 parts, a system wide daemon spice-vdagentd and a X11 session agent spice-vdagent of which there is one per X11 session.
> spice-vdagent gets automatically started in desktop environments which honor /etc/xdg/autostart, and under gdm. And here[1] is the relevant configuration.

(In reply to Rex Dieter from comment #6)

> So suggestion is:
> 
> - either remove X-GNOME-Autostart-Phase
>   or
> - provide systemd user service for it

I just tested this on a fresh Fedora 34 Plasma Spin VM. Commenting out the `X-GNOME-Autostart-Phase` line in `/etc/xdg/autostart/spice-vdagent.desktop` does not fix the problem.

After rebooting the system and logging in to the KDE Wayland Session, I ran `pgrep -afx /usr/bin/spice-vdagent`, but it still wasn't running. The systemd units spice-vdagentd.service and spice-vdagentd.socket start correctly, however. On my Fedora Workstation 34 (Gnome) VM, both parts start correctly.

[1]: https://manpages.debian.org/testing/spice-vdagent/spice-vdagent.1.en.html
[2]: https://rentry.co/ep87w

Comment 14 Maxwell G 2021-07-14 00:56:56 UTC
Please excuse my typo. There was a missing new line between lines 5 and 6.
(In reply to Maxwell G from comment #13)
> Just to be clear, spice-vdagent has two parts. According to man
> spice-vdagent[1]:
> 
> > The spice guest agent for Linux consists of 2 parts, a system wide daemon spice-vdagentd and a X11 session agent spice-vdagent of which there is one per X11 session.
> > spice-vdagent gets automatically started in desktop environments which honor /etc/xdg/autostart, and under gdm. 
> And here[1] is the relevant configuration.

Comment 15 Rex Dieter 2021-07-14 13:45:42 UTC
Re: comment 13

Hrm, turns out systemd initiated autostart will likely not work, since this daemonizes itself, and the autogenerated service may thing the service has ended at that point.

Try changing /etc/xdg/autostart/spice-vdagent.desktop Exec= line to include -x flag

Exec=/usr/bin/spice-vdagent -x

(any systemd user unit will need to run it the same way)

Comment 16 Rex Dieter 2021-07-14 13:48:18 UTC
While on the topic, has spice-vdagent upstream been engaged on this topic?  If not, maintainers, I strongly recommend you do.

Comment 17 Rex Dieter 2021-07-14 14:11:32 UTC
In the meantime, one of our plasma users posted this to mailing list recently, this could be used as a good starting point for a systemd user unit:

To test, create file: ~/.config/systemd/user/spice-vdagent.service with contents:

[Unit] 
Description=Spice guest session agent
After=plasma-core.target 

[Service] 
ExecStart=/usr/bin/spice-vdagent -x
 
[Install] 
WantedBy=plasma-core.target

Obviously, anything system-wide and/or upstreamable would not include those plasma-core dependencies here (those would be included in plasma .service files)

Comment 18 Maxwell G 2021-07-14 14:21:22 UTC
(In reply to Rex Dieter from comment #16)
> While on the topic, has spice-vdagent upstream been engaged on this topic? 
> If not, maintainers, I strongly recommend you do.

Neither the package maintainer nor the upstream maintainers have been involved in this thread.

Comment 19 Fedora Update System 2021-07-14 16:40:16 UTC
FEDORA-2021-05fdb1456c has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-05fdb1456c

Comment 20 Rex Dieter 2021-07-14 16:41:18 UTC
Sad, ok.  I took the liberty of importing a candidate fix and submitting the bodhi update then.

For folks who inevitably won't read the update notes :)

"Provide user spice-vdagent.service for environments that may needed (like systemdboot enabled plasma sessions). This is a prerequisite to fixing https://bugzilla.redhat.com/show_bug.cgi?id=1951580 (not a complete fix on it's own)."

Comment 21 Rex Dieter 2021-07-14 16:42:47 UTC
*** Bug 1928446 has been marked as a duplicate of this bug. ***

Comment 22 Ed Greshko 2021-07-14 19:16:25 UTC
FWIW, while the systemd user unit works for Plasma Xorg it may not be as effective on Plasma Wayland.

First, when adding the individual systemd user unit the user must remember to enable it themselves with "systemctl --user enable name-off-unit",

Second, when running Plasma Wyland /usr/bin/spice-vdagent -x will start via this method.  However, I'm unable to copy text from a konsole window
of the host (Running Plasma Xorg) to a konsole window on the guest running Plasma Wayland.  It seems to me that this may be related more towards
how the clipboard of Wayland is implemented.

Besides, the man page for spice-vdagent does say....

The  spice guest agent for Linux consists of 2 parts, a system wide dae‐
mon spice-vdagentd and a X11 session agent spice-vdagent of which  there
is one per X11 session.

So, it would seem that it is X11 only.

Comment 23 Fedora Update System 2021-07-15 01:40:43 UTC
FEDORA-2021-05fdb1456c has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-05fdb1456c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-05fdb1456c

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 24 Ed Greshko 2021-07-15 05:25:55 UTC
BTW, the system-wide user unit supplied in the new build of spice-vdagent cant' work.  It is a static unit without
a trigger.

Comment 25 Ed Greshko 2021-07-15 10:43:17 UTC
As I mentioned, I have installed the latest spice-vdagent-0.21.0-3.fc34.
I rebooted and then logged in as a user.  
/usr/bin/spice-vdagent was not running after login.

I then modified /usr/lib/systemd/user/plasma-core.target to have

[root@f34k ~]# cat /usr/lib/systemd/user/plasma-core.target
[Unit]
Description=KDE Plasma Workspace Core
Wants=plasma-plasmashell.service plasma-kcminit.service plasma-kded.service plasma-kcminit-phase1.service graphical-session-pre.target spice-vdagent.service
Requires=plasma-ksmserver.service
BindsTo=plasma-ksmserver.service
After=graphical-session-pre.target
Before=ssh-agent.service
RefuseManualStart=yes

Then when the user logs in I get....

[egreshko@f34k ~]$ ps -eaf | grep spice
egreshko    3377    3213  0 18:32 ?        00:00:00 /usr/bin/spice-vdagent -x
root        3382       1  0 18:32 ?        00:00:00 /usr/sbin/spice-vdagent

Comment 26 Rex Dieter 2021-07-15 17:35:20 UTC
re comment #22

As I mentioned in comment #20, this alone is indeed not a complete fix.  It only provides the service unit.

Next step is to decide where/how best to get it started when needed:
* add service unit dependency somewhere (probably best, an example of that is comment #25 )
* enable preset to enable automatically for all users
* some better idea?

Comment 27 Ed Greshko 2021-07-15 19:14:54 UTC
(In reply to Rex Dieter from comment #26)

> As I mentioned in comment #20, this alone is indeed not a complete fix.  It
> only provides the service unit.

OK.  I was under the mistaken assumption that if a package is sent to updates-testing it is actually
an attempt to fix the problem.  I didn't understand that it is also meant to ensure that the work done
to this point didn't make things worse.

Comment 28 Rex Dieter 2021-07-15 20:56:52 UTC
*** Bug 1981338 has been marked as a duplicate of this bug. ***

Comment 29 Rex Dieter 2021-07-16 15:27:53 UTC
Posted followup to spice-devel mailing list for feedback, and request they adopt the new systemd unit,
https://lists.freedesktop.org/archives/spice-devel/2021-July/052402.html

Comment 30 Fedora Update System 2021-07-16 15:47:22 UTC
FEDORA-2021-05fdb1456c has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-05fdb1456c

Comment 31 Rex Dieter 2021-07-16 15:48:46 UTC
The bodhi update has now been refreshed to add plasma-workspace build that includes systemd dependency to run spice-vdagent.service on login.

Comment 32 Fedora Update System 2021-07-17 01:06:52 UTC
FEDORA-2021-05fdb1456c has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-05fdb1456c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-05fdb1456c

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 33 Ed Greshko 2021-07-17 04:38:11 UTC
I have 2 comments.

Since the updates appeared in updates-testing I tried.

sudo dnf --refresh --enablerepo updates-testing update spice-vdagent

expecting this to pullin the needed plasma-workspace packages.  It didn't. I had to use

sudo dnf --refresh --enablerepo updates-testing update spice-vdagent plasma-workspace

Second, has consideration been given to making the /usr/lib/systemd/user/spice-vdagent.service

[Unit] 
Description=Spice guest session agent

[Service] 
ExecStart=/usr/bin/spice-vdagent -x
ConditionVirtualization=vm

Such that /usr/bin/spice-vdagent -x is only run in a virtual environment?  I don't think it would
be need to run when running on bare metal?

Comment 34 Fedora Update System 2021-07-18 01:24:08 UTC
FEDORA-2021-05fdb1456c has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.