Unable to launch Virtual Machine with lxc

Hi, I encountered an error while launching a VM with LXC, I always get this error:

Creating the instance
Error: Failed instance creation: Failed creating instance from image: Failed reading image info "/var/lib/lxd/storage-pools/default/images/f217de8a505d919f42cac6a898ac66fdf582b8ccc092d73189b46101615f3612/root.img": Failed to run: qemu-img info --output=json /var/lib/lxd/images/f217de8a505d919f42cac6a898ac66fdf582b8ccc092d73189b46101615f3612.rootfs: 

Here’s a list of things I have tried:

  1. Adding my user to lxd group
  2. Enabling lxcfs
  3. chmod 777 /var/lib/lxd

None of them worked, this is my configuration:

        lxc = {
            enable = true;
            lxcfs.enable = true;
            defaultConfig = "lxc.include = ${pkgs.lxcfs}/share/lxc/config/common.conf.d/00-lxcfs.conf";
        lxd = {
            enable = true;
            recommendedSysctlSettings = true;