Score:0

Copy & paste does not work between host and guest ubuntu, spice installed

ng flag

I have a QEMU VM, both the host and guest OS being ubuntu 20.04. I wanna enable copy & paste function between the host and guest. I have read the answers of following two thread:

  1. How can I copy&paste from the host to a KVM guest?

  2. https://unix.stackexchange.com/questions/109117/virt-manager-copy-paste-functionality-to-the-vm

But none of them work. I have installed spice-vdagent and checked that it's loaded. So does Spice work only for GUI mode of Ubuntu guest OS? Does it work for pure text mode guest and graphics host?

PS: I know I can ssh, I just wanna know if Spice works for text mode settings.

Score:1
fr flag

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 :

  1. Install spice-vdagent package on the guest system ;
  2. 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).
  3. 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>
  1. 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.

Rafael avatar
to flag
This worked for me, but I had to execute `spice-vdagent --display=QXL` on the guest
Max avatar
fr flag
Max
Still works in ´22. Manjaro host - Windows 10 guest. (used Virtio Video instead of QXL)
karel avatar
sa flag
How do you enable Virtio Video instead of QXL in Ubuntu?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.