So I am very new to NixOS as of today and testing it out in a VM in KVM on my Fedora host.
I am trying to get the copy/paste feature working in the VM but, so far, I have been unsuccessful. I have added the following packages to my config:
Am I missing something?
If need be, I can post my complete config.
Also, for my understanding, after I make these changes and run sudo nixos-rebuild switch is there a need to reboot the machine to get the new config to work?
Thanks in advance from a complete noobie.
Then you have to enable the guest SPICE system-wide daemon
services.spice-vdagentd.enable = true
and, crucially, you need to make sure the per-session agent is started as part of your graphical session. For the latter, if youâre running a DE that implements the XDG autostart spec youâre done, otherwise you need to run spice-vdagent manually (after the X server, in your login session).
Finally, you start the VM as usual but no window will open, instead to connect to the VM you need a SPICE client, like spicy (pkgs.spice-gtk) and specify localhost:5924 (port specified in the qemu.options) as host.
After all of this you get:
automatic display resizing that follows the window size
After adding imports = [ <nixpkgs/nixos/modules/virtualisation/qemu-vm.nix> ]; , I got thrown into emergency mode, when rebooting I get
mounting nix-store on /nix/.ro-store...
[ 1.560235] 9pnet_virtio: no channels available for device nix-store
mount: mounting nix-store on /mnt-root/nix/.ro-store failed No such file or directory
mounting shared on /tmp/shared...
[ 1.408774] 9pnet_virtio: no channels available for device shared
mount: mounting shared on /mnt-root/tmp/shared failed: No such file or directory
Huh. Looks like the qemu-vm.nix module just sets up a bunch of shared directories even though the documented default for virtualisation.sharedDirectories is { }.
It works now when I use spice-vdagent, thanks.
But the automatic display resizing doesnât work unfortunately, and Iâm stuck with a 1024 x 768 resolution.