I have been trying to get a basic NixOS VM working so I can test my home-manager configuration. This blog post blew my mind. The code for the actual VM in that post is here and I can reproduce it with working copy/paste between my NixOS host and the VM.
However, if I switch to GNOME I lose the ability to copy and paste:
I believe the ‘xserver’ is basically an anachronism here and this installs the Wayland version of GNOME.
Does anyone have a shared clipboard working for a NixOS VM running GNOME? I would also appreciate pointers towards documentation. What I have found so far is very scattered and lacks context.
I don’t believe spice-vdagent supports Wayland. You can still run a GNOME session under Xorg for now, by clicking the little gear in GDM (see here for example), and that’ll probably help.
Thank you for the suggestion. The gear is not visible, but I was able to switch to Xorg by setting services.xserver.displayManager.gdm.wayland = false;. I still haven’t been able to get the clipboard working.
In case anyone else is trying to get a GNOME NixOS VM running using nix-build, I also had to add a swapfile or GNOME would run out of memory and crash after a few seconds:
Are you sure? Note that it’ll only appear after you’ve selected or typed in your user name.
That setting will control whether GDM uses Wayland, but not whether your user session uses Wayland. You can check the latter in GNOME (version 45; these names will have changed in 46) by going into Settings, clicking About in the sidebar, and clicking System Details; the Windowing System entry will tell you what sort of session you’re running (X11 or Wayland). Or you can run