Virt-manager - cannot create VM


I am trying to create a VM using virt-manager. Unfortunatelly, I am running into an error (logs bellow). My configuration.nix contains both lines from wiki.

Error launching details: 'NoneType' object has no attribute 'conn'

Traceback (most recent call last):
  File "/nix/store/k3k8d8zn5dnyf8y638yx4zzjvb6y9cxk-virt-manager-4.1.0/share/virt-manager/virtManager/", line 36, in get_instance
    key = "%s+%s" % (vm.conn.get_uri(), vm.get_uuid())
AttributeError: 'NoneType' object has no attribute 'conn'
Error starting installation: constructor returned NULL

Traceback (most recent call last):
  File "/nix/store/k3k8d8zn5dnyf8y638yx4zzjvb6y9cxk-virt-manager-4.1.0/share/virt-manager/virtManager/", line 1881, in _finish_clicked
    self._start_install(guest, installer)
  File "/nix/store/k3k8d8zn5dnyf8y638yx4zzjvb6y9cxk-virt-manager-4.1.0/share/virt-manager/virtManager/", line 1978, in _start_install
  File "/nix/store/k3k8d8zn5dnyf8y638yx4zzjvb6y9cxk-virt-manager-4.1.0/share/virt-manager/virtManager/", line 270, in run
    Gdk.Cursor.new_from_name(gdk_window.get_display(), "progress"))
TypeError: constructor returned NULL

I am not sure, what do do. Could someone please point me in a right direction?

It looks like another NixOS user had your exact problem (see this nixpkgs issue). According to them, the problem is a missing GTK cursor. They use home-manager, and solved their problem by setting this option:

home.pointerCursor.gtk.enable = true;

At what point in the process does this error occur? I also run virt-manager on my nixos machine, but I haven’t created a VM in some time, so I’m not sure whether or not this bug also affects me. (EDIT: I also do not use home-manager.) I use KDE Plasma 5; it’s possible that that brings in a compatible cursor. What desktop environment/window manager are you using?

I use KDE Plasma 5

should be fine since most desktop-environments bring some gtk and qtdefaults, including cursor

That was it, thank you.

I tried it, but at first, it threw errors at me. I had to change up the config a bit, but it works now. I was confused, because prior to reinstalling NixOS to encrypt the partition with LUKS, I didn’t have this setting and it worked.

Anyway, it does now. Thank you again!