Clipboard sharing with spice-vdagent not working

Installed nixos on a VM using UTM, and copy and paste doesn’t work when I have spice-vdagent enabled. I can manually start it without errors with systemctl start spice-vdagentd but nothing really changes. The service doesn’t start on its own upon reboot either.

I have these added to the default configuration.nix file:

nix.settings.experimental-features = [ "nix-command" "flakes" ];

services.qemuGuest.enable = true;
services.spice-vdagent.enable = true;

...

environment.systemPackages = with pkgs; [
    wget
    neovim
    spice
    spice-vdagent
];
  1. Are you using a wayland compositor? If so, I don’t think it’s supported.

  2. spice-vdagentd is just one component, there’s also a per-desktop session daemon running as your user. Do you see that? If not, try starting spice-vdagent manually.

No there’s no compositor installed, it’s a clean install of minimal nixos. I did try starting the service manually, and it runs fine. But I still can’t copy and paste.

No there’s no compositor installed

Are you saying there’s no graphical session? The Linux virtual terminal has no concept of clipboard, you need an X server for this to work.

I did try starting the service manually, and it runs fine

As I said, that’s one daemon, but there’s another one that needs to be started as you user (not root), after your graphical session (it needs access to $DISPLAY). If you use a DE with the XDG autostart mechanism, it will be started automatically, otherwise you can simply by run the command spice-vdagent.

1 Like

Oh I see how badly I misunderstood now, my bads. So basically on a minimal install of even Ubuntu server clipboard functionality doesn’t exist?

Yes, NixOS has nothing to do with this.