2

I am running a fleet of KVM machines on Ubuntu 19.10 host. The fleet includes both Linux and Windows guests, and all of them share this issue:

Copy with Ctrl+C only works every second time. That is, inside a KVM guest I select some text on a webpage, hit Ctrl+C, place cursor in a textarea, hit Ctrl+V. One time it works, the other does not. Perfectly consistent alternation. Both Linux and Windows guests.

Now, the most interesting part is that the issue only happens when the guests are configured to use Spice as display protocol. If I change it to VNC, copy-paste (within the guests) works perfectly. (Note that I do not care much of copy-paste between guest and host at this point, so I could just switch to VNC and be happy, but I am digging this anyway.)

Search has found people do experience this issue, though there is no clear indication that it is related to Spice there:

So, in my case the relation of this issue to Spice is clear. Is there any way I could debug/tweak Spice to find the bottom of it?

UPDATE

I just tested this issue on 18.04 and 19.04 hosts. Clipboard copy glitches (similar to those described above) do occur in guests too but only when there are at least 2 guests running — as if Spice runs into some sort of race condition trying to manage clipboards between all running guests. Pausing all guests but one is enough to get clipboard work fine in it. In contrast, with 19.10 the issue occurs even with just one running guest.

1 Answers1

0

virt-viewer version 9.0 have an option to enabled/disable clipboard share, it can be turned on/off any time from settings, this solve the problem, but latest Ubuntu release have version 7.0, Ubuntu 18.04 have version 6.0

One way to fix this is to backport this commit and rebuild virt-viewer package from start

Here are the steps:

sudo apt build-dep virt-viewer
apt source  virt-viewer
cd virt-viewer-7.0 # or virt-viewer-7.0

Download and apply this patch, but it have some conflicts with current ubuntu version, this is the same patch with conflicts resolved:

wget https://pastebin.com/raw/yNNp40D9 -O cliboard-patch.diff
patch -p1< cliboard-patch.diff

You may need to resolve some conflicts depnding on your ubuntu/distor version After that:

./configure --prefix=/usr
make

Test the new compiled file at ./src/remote-viewer, you have to disable clipboard share from File menu > Preference

If it work, install in on your filesystem

sudo make install
Ahmed
  • 428