Virt-manager, share clipboard between vm and host

On my quest to set up a functional Gentoo install with runit, I wanted to be able to copy and paste between the virtual machine and host to make my life easier as there were going to be lots of commands and scripts to type, and I like taking notes on them.

Since my goal was replacing OpenRC with runit on Gentoo, no distro does it better than Void Linux. But looking at their ISOs, they are nearly two years old (at the time of writing this), and while that should be fine for an installation, it's a no go for working in a live environment as it will spit out no end of errors if I need to install a package on it. So I decided to look for a Void based distro that could have a more updated ISO, there aren't many but I found AgarimOS, they have several up to date ISOs each with a different desktop flavour, I went with MATE, created a virtual machine boot it and...

















...I get this lovely desktop, looks good but a bit distracting for me.

My virtual machine already has spicevmc





















but if it didn't, all I had to do was click on add hardware, Channel, and select Spice agent (spicevmc) as the device type.





















Back to the live environment now I needed to install the spice-vdagent package
 

~ $ sudo xbps-install -Sy spice-vdagent
and enable it
~ $ sudo ln -s /etc/sv/spice-agentd /var/service/ # check if the daemon is running ~ $ sudo sv status spice-vdagentd run: spice-vdagentd: (pid 2483) 34s
now the system daemon handled communication with QEMU, but now I needed a separate user-space process to bridge it to my host's desktop

~ $ spice-vdagent -x # the -x flag forced it to debug and reconnect it to the socket if it got stalled
et voila...


Comments

Popular Posts