Why is nixos-rebuild and nix-channel update asking for /run/binfmt

Trying a simple nixos-rebuild, I get:

 paths will be fetched (89.93 MiB download, 383.38 MiB unpacked):
  /nix/store/i3mcdchja7x41dj6mknzy16cw1rpcrgx-curl-8.4.0
  /nix/store/jl16fcg30sin495jhcag0wlyngvcqpvm-curl-8.4.0-bin
  /nix/store/hh4gnflqcfs97kpnis44p1yf5jg1vmjk-curl-8.4.0-dev
  /nix/store/cb9784707mflgm5hc0ms8zfrj01adimi-elfutils-0.190-dev
  /nix/store/lvwdgsbcamflqfhydzqyc1ylvrwv4zfh-libffi-3.4.4
  /nix/store/6m1dbv9bmdiyjwzcbi15r8syp17yy6sn-libkrb5-1.20.2-dev
  /nix/store/xkfmhnfpwx87qn7sbhmkisl83ba18l3s-libssh2-1.11.0
  /nix/store/0y28w3rxffnhi1vf2x22g31h61qyvig3-libssh2-1.11.0-dev
  /nix/store/1a7bnzx9lash058zyy226256mm9g0vi8-linux-6.8.6-dev
  /nix/store/c88fyb3azb2plhyz7ynyi8lkyc290lzi-openssl-3.0.13-bin
  /nix/store/dly1kpml75dl2gymydrgwgnc8z6np7q1-openssl-3.0.13-dev
  /nix/store/czqlzqjil64c5r4hrfdn1arxka24sya7-python3-minimal-3.11.8
setting up chroot environment in '/nix/store/8kd6bkw3g720ig70ii6dwr3ym29891cj-ensure-all-wrappers-paths-exist.drv.chroot'
executing builder '/nix/store/m0s1xf30bdk6vfn5m6c3mhb2z8w1cib5-bash-5.2-p15/bin/bash'
using builder args '-e /nix/store/v6x3cs394jgqfbi0a42pam708flxaphh-default-builder.sh'
error:
       … while setting up the build environment

       error: getting attributes of path '/run/binfmt': No such file or directory

I’ve removed everything relating to virtualization, qemu, virtualbox, etc, but it’s still spitting that error out.

I am on linux-6.9-rc3, so that’s probably related, but I need to build something I can switch into.

I did a garbage clean, which was probably not a good idea, cause now I don’t have any version of the OS to switch back to.

I also see this same error when I try to update the channel:

$ sudo nix-channel --update
unpacking channels...
error:
       … while setting up the build environment

       error: getting attributes of path '/run/binfmt': No such file or directory
error: program '/nix/store/b9iwk28nd0h9z8gpyr3fcr1xjlwnavmc-nix-2.18.1/bin/nix-env' failed with exit code 1

Answer here

Seems to need --option sandbox false Change root - NixOS Wiki
It solved my case.