Page MenuHomeSolus

Shared clipboard is not working in virt-manager VM guest
Closed, ResolvedPublic

Description

Clipboard sharing between Solus host and Solus guest VM no longer works

I can't copy & paste into the VM. I also can't copy & paste from the VM to the host.
virt-manager, version: 4.1.0, release: 37
spice-gtk, version: 0.41, release: 26

The clipboard functionality worked as expected until recently. I first noticed it about a week ago, when I started the VM guest (I hadn't started it in a while)
This may be related to recent updates to either virt-manager or spice-gtk
The guest VM has existed for a long time on this machine. No changes have been made in the VM configuration.
Both host and guest are on the stable repo and fully updated

I'm happy to provide any information needed and do any troubleshooting or testing I can.

Host:
Operating System: Solus 4.3
KDE Plasma Version: 5.25.3
KDE Frameworks Version: 5.96.0
Qt Version: 5.15.5
Kernel Version: 5.15.61-217.current (64-bit)
Graphics Platform: X11
Processors: 16 × 11th Gen Intel® Core™ i7-11800H @ 2.30GHz
Memory: 62.5 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2
Manufacturer: Dell Inc.
Product Name: XPS 17 9710

Event Timeline

Seems to only affect Plasma. May be a red herring but noticed this.

sudo systemctl status spice-vdagentd.service

○ spice-vdagentd.service - Agent daemon for Spice guests
     Loaded: loaded (/usr/lib/systemd/system/spice-vdagentd.service; indirect; vendor preset: enabled)
     Active: inactive (dead)
TriggeredBy: ● spice-vdagentd.socket
  Condition: start condition failed at Fri 2022-08-26 19:43:07 AEST; 3s ago
             └─ ConditionVirtualization=yes was not met

Aug 26 19:33:45 sokar systemd[1]: Agent daemon for Spice guests was skipped because of a failed condition check (ConditionVirtualization=yes).

No such error on Budgie guest where copy/paste works.

Both my host machine and guest are running Plasma

I checked sudo systemctl status spice-vdagentd.service on the Plasma guest. It shows active (running), even though clipboard sharing isn't working.
I tried restarting the service, just to see, and it didn't change anything.

ermo triaged this task as Needs More Info priority.May 9 2023, 8:39 PM
ermo edited projects, added Software, Plumbing; removed Lacks Project.
ermo added a subscriber: ermo.

@TClark77

Is this still an issue for you?

@ermo Yes, this is still an issue

virt-manager, version: 4.1.0, release: 39
spice-gtk, version: 0.42, release: 27

Host:
Operating System: Solus 4.3
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.9
Kernel Version: 6.2.14-232.current (64-bit)
Graphics Platform: Wayland
Processors: 16 × 11th Gen Intel® Core™ i7-11800H @ 2.30GHz
Memory: 62.5 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics
Manufacturer: Dell Inc.
Product Name: XPS 17 9710

ermo raised the priority of this task from Needs More Info to Normal.May 9 2023, 9:29 PM

I may have found something useful. Of course, spice-vdagent is installed on both host and guest. (It had to have been, this worked before).

systemctl on the VM shows spice-vdagentd.service active and running.

However, on the host (laptop)

❯ systemctl status spice-vdagentd.service
○ spice-vdagentd.service - Agent daemon for Spice guests
     Loaded: loaded (/usr/lib/systemd/system/spice-vdagentd.service; indirect; preset: enabled)
     Active: inactive (dead)
TriggeredBy: ● spice-vdagentd.socket
  Condition: start condition failed at Mon 2023-05-08 21:02:49 CDT; 22h ago
             └─ ConditionVirtualization=yes was not met

Looking in journalctl logs I found

May 08 20:03:30 tlc-xps17-solus systemd-tmpfiles[515]: /usr/lib64/tmpfiles.d/spice-vdagent.conf:1: Line references path below legacy directory /var/run/, updating /var/run/spice-vdagentd → /run/spice-vdagentd; please update the tmpfiles.d/ drop-in file accordingly.
May 08 20:03:30 tlc-xps17-solus systemd-tmpfiles[609]: /usr/lib64/tmpfiles.d/spice-vdagent.conf:1: Line references path below legacy directory /var/run/, updating /var/run/spice-vdagentd → /run/spice-vdagentd; please update the tmpfiles.d/ drop-in file accordingly.
May 08 20:03:30 tlc-xps17-solus systemd-tmpfiles[609]: /usr/lib64/tmpfiles.d/spice-vdagentd.conf:2: Duplicate line for path "/run/spice-vdagentd", ignoring.

Change most recently before this stopped working:
https://dev.getsol.us/R3132:8e04b6fe2eb870a3ac9a94126fcafdc26362ce93

[slowly dumping stuff from my phone]
According to a comment in the Endeavour forums this might be related to a gnome-session condition in /usr/share/xdg/autostart/spice-vdagent.desktop

https://forum.endeavouros.com/t/kde-refuses-to-start-spice-vdagent-on-login/33579/12

Okay, so after some investigation this is a combination of two things

  1. Plasma no longer seems to load .desktop files from /usr/share/xdg/autostart/
  2. The X-GNOME-Autostart-Phase=WindowManager line in the .desktop file seems to prevent it launching under Plasma altogether

When you both move/copy the /usr/share/xdg/autostart/spice-vdagent.desktop file to /etc/xdg/autostart/ and remove the offending line from it, it works.

The first part of the problem could also be the reason for Plasma users no longer seeing the update notification (as that file is in /usr/share/xdg/autostart/solus-update.desktop)
edit: in fact in that case it's also a combination of the location and X-GNOME-Autostart entries in the .destkop file

ermo changed the task status from Open to In Progress.EditedMay 10 2023, 12:02 PM
ermo assigned this task to ReillyBrogan.
ermo added a subscriber: ReillyBrogan.

I would honestly just copy the edited spice-vdagent.desktop file to ~/.config/autostart/ directory in the VM as a workaround, until proper stateless support is restored for reading from /usr/share/xdg/autostart in whatever part of KDE is responsible for this?

@ReillyBrogan ?

  • Plasma no longer seems to load .desktop files from /usr/share/xdg/autostart/
  • The X-GNOME-Autostart-Phase=WindowManager line in the .desktop file seems to prevent it launching under Plasma altogether

I found this issue which might be relevant:

https://github.com/systemd/systemd/issues/18791

Okay, can confirm that this systemd patch fixes the second part of the issue with X-GNOME-Autostart-Phase=
(both for spice-vdagent and solus-update-checker)

This the kde autostart paths

AutostartModel::AutostartModel(QObject *parent)
    : QAbstractListModel(parent)
    , m_xdgConfigPath(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation))
    , m_xdgAutoStartPath(m_xdgConfigPath.filePath(QStringLiteral("autostart")))

We have already patched qt5-base for stateless xdg paths

It could also be due to systemd-xdg-autostart-generator not loading from the path anymore as part of the systemd update.