Anyone know how to get Virtual Manager to install copy-paste functionality to the Virtual Machine?
You have to use "Spice" instead of "VNC" :
- No more need to install spice-gtk : virt-manager has now a spice-gtk client built-in. But you need to install
spice-client-gtkon debian) on the vm host (if you use virt-manager on another machine to connect to the vm host remotely through ssh, you must also install
python-spice-client-gtkon that machine)
- Start virt-manager
- Select you virtual machine
- Power on the virtual machine
- Connect to your guest with ssh ; in the guest, install spice-vdagent and verify that spice-vdagentd is launched (
ps -lef|grep spice-vdagentdwill return you the process if its running)
- Show virtual hardware details
- Select Display VNC and change VNC to Spice and accept to add the Channel
- Change the Video model from Cirrus (the default) to QXL
- Restart virt-manager and power on the virtual machine
You are using Spice.
Another solution, without X, but assuming that you are able to ssh to your host from your machine, and to your vm from your host :
With a Linux (Debian 11/bullseye) host and a Windows 10 guest, I did the following to enable copy-and-paste between the guest and the host:
spice-guest-toolson Windows guest; the binaries can be downloaded from https://www.spice-space.org/download.html.
spice-vdagenton Linux host.
virt-manager(on host) change the Windows VM configuration:
- Set the 'Display' to 'Spice'.
- Add a 'spicevmc' Channel (via 'Add Hardware');
The XML data will be:
address type="virtio-serial" controller="0" bus="0" port="2"
- In Linux host, enable
# systemctl enable spice-vdagentd.service`
- Restart Linux.
The copy-and-paste functionality is ready to use.
Another option is to use Barrier (software-based KVM) https://github.com/debauchee/barrier.
Install it on your host as the server. Install it on your VM as a client.
Here is what my client setup looks like.
Next, tell Barrier where (spatially) your client is. This is personal preference, but I set mine to be above my host. It is kind of awkward since the VM obviously is nested inside your host, but it still works very well.
Configure Server on Barrier running on your host machine. Here is my setup:
What you label the screen matters here. Notice, in my first image, the
Screen name is "jareds-iMac". This has to match.
With this setup, when you move your mouse past the top of your screen, it switches into the VM. Copy-paste will work from host to machine and vice-versa. An added benefit is that you don't have to press any hotkeys to release the "grab" from the VM.