Had the same issue with the same setup (host and guest both running Ubuntu 20.04), and I also struggled to solve it by following the answers from the multiple threads that I saw online.
This was because no SPICE agent channel was defined in my VM's XML configuration file.
The complete solution for me was therefore the following :
- Install
spice-vdagent
package on the guest system ;
- In the virtual machine's settings, set the "Display" option to "Spice server" instead of "VNC server" (
graphics type="spice"
in XML), and set "Video" to "QXL". With virt-manager
, this is done by selecting (opening) the virtual machine and going to the "Show virtual hardware details" tab (white "i" on a blue dot icon).
- Create a channel for the SPICE agent. With
virt-manager
, select the virtual machine and go to the "Show virtual hardware details" tab again, then click "Add Hardware" at the bottom and select "Channel" with "Spice agent (spicevmc)" and finally hit "Finish".
In the XML configuration, the channel should look like this (adapt the numbers to your setup) :
<channel type="spicevmc">
<target type="virtio" name="com.redhat.spice.0"/>
<address type="virtio-serial" controller="0" bus="0" port="2"/>
</channel>
- Apply the changes by rebooting the VM or just logging out and back in. Restarting
virt-manager
may also be necessary.
After doing all of that, copy and paste works just fine between my two systems.