I wrote a more detailed article Install QEMU/KVM/Virt-Manager on ArchLinux but here I will focus on installing guest additions for QEMU/KVM on Debian. By that I mean support for shared folder, shared clipboard, VirtIO devices.
VirtIO kernel modules could be auto-loaded automatically but in case it is not one
has to edit /etc/initramfs-tools/modules
and add the following modules:
Then we can force rebuild the init ramdisk:
Install QEMU guest additions:
Since the VM will be using SPICE we can improve the user experience by installing
spice-vdagent
to enable shared clipboard.
Then to get shared folder working with virtio-9p
, we can follow the following steps.
In virt-manager VM settings:
- Hit the Add Hardware button
- Choose a Filesystem device
- Select virtio-9p as Driver
- Define the source path (folder to share from the host) and target path (a mount tag)
And in the guest, mount the share:
For example:
Note: it's possible to tweak the msize option to increase performance.
It's also possible to add it to /etc/fstab
to mount it automatically.