RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1340160 - vdagent doesn't work after switching between systemd targets
Summary: vdagent doesn't work after switching between systemd targets
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: spice-vdagent
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jonathon Jongsma
QA Contact: SPICE QE bug list
URL:
Whiteboard:
Depends On: 1518411
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-26 14:43 UTC by Andrei Stepanov
Modified: 2018-04-10 18:52 UTC (History)
7 users (show)

Fixed In Version: spice-vdagent-0.14.0-15
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 18:51:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
spice-vdagent log (18.92 KB, text/plain)
2016-05-27 09:14 UTC, Andrei Stepanov
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:1017 0 None None None 2018-04-10 18:52:02 UTC

Description Andrei Stepanov 2016-05-26 14:43:18 UTC
spice-vdagentd has broken functionality after switching between systemd targets.

spice-vdagent-0.14.0-10.el7.x86_64

How reproducible: always

Steps to Reproduce:
1. Boot a VM.
2. Connect with remote-viewer to the VM.
3. Authorize in GDM.
4. Open a terminal.
5. Check running processes: 

$ ps axu | grep spice
root       702  0.0  0.0  47908   736 ?        Ss   15:27   0:00 /usr/sbin/spice-vdagentd
gdm       2816  0.0  0.1  30672  1456 ?        Ss   15:27   0:00 /usr/bin/spice-vdagent
astepano  3264  0.0  0.1  30644  1256 ?        Ss   15:28   0:00 /usr/bin/spice-vdagent

6. Switch to multi-user target:

# systemctl isolate multi-user.target

7. System is in text mode. And has running processes:

gdm       2816  0.0  0.1  29896  1504 ?        Ss   15:27   0:00 /usr/bin/spice-vdagent
astepano  3264  0.0  0.1  29868  1308 ?        Ss   15:28   0:00 /usr/bin/spice-vdagent

8. Switch back to graphical target:

# systemctl isolate graphical.target

9. Authorize in GDM.

10. Check running processes:

gdm       2816  0.0  0.1  29896  1504 ?        Ss   15:27   0:00 /usr/bin/spice-vdagent
astepano  3264  0.0  0.1  29868  1308 ?        Ss   15:28   0:00 /usr/bin/spice-vdagent
gdm       6090  0.0  0.0  29868   440 ?        Ss   16:37   0:00 /usr/bin/spice-vdagent
astepano  7481  0.0  0.0  29868   440 ?        Ss   16:37   0:00 /usr/bin/spice-vdagent


Actual results:

1. Copy-paste functionality between client-guest is broken.
2. Guest's screen resolution doesn't adjust to remote-viewer geometry.

Comment 1 Andrei Stepanov 2016-05-27 09:14:14 UTC
Created attachment 1162404 [details]
spice-vdagent log

Comment 2 Victor Toso 2016-09-09 12:45:47 UTC
Not urgent, let's move to 7.4

Comment 3 Victor Toso 2017-05-30 13:19:24 UTC
No fix yet

Comment 4 Jonathon Jongsma 2017-06-16 20:43:17 UTC
So, when using systemd as the init system, the system vdagent daemon is a hardware-activated service. In other words, it is only started when the appropriate virtio port device is added. At boot, the device is added, which causes a udev rule to add spice-vdagentd.target to the list of targets wanted by systemd. 

When you issue the command "systemctl isolate multi-user.target", it starts the multi-user.target unit (and all of its dependencies) and stops all others. Since spice-vdagent.target is not a dependency of multi-user.target, it will get stopped.

Now you issue the command "systemctl isolate graphical.target", and it starts the graphical.target unit and stops all others. This still does not start the vdagent service because it is not a dependency of graphical.target either. The only thing that starts the spice-vdagentd service is the udev "add" event for the appropriate virtio device. 

At this point, you can fix this issue by manually starting the vdagent daemon before logging back into GNOME:
systemctl start spice-vdagentd.service

I think we could also patch the vdagent daemon so that it supported systemd socket activation. Then when the user session agent was started, it would attempt to connect to the system daemon socket, which would cause the system daemon to get restarted. I have a proof of concept that does this and it seems to work.

Comment 5 Jonathon Jongsma 2017-07-14 16:45:14 UTC
potential fix sent to mailing list: https://lists.freedesktop.org/archives/spice-devel/2017-July/038658.html

Comment 6 Jonathon Jongsma 2017-07-24 16:40:56 UTC
pushed upstream: 183e2fec3518d36aeaabffff4892a7ec6af61363

Comment 14 errata-xmlrpc 2018-04-10 18:51:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:1017


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