Nixos on OVH kimsufi: cloning builder process: Operation not permitted

The solution is: don’t chroot, pivot_root.

  1. Set up your chroot environment as you were, in say /real-root, and get the path to init (e.g. INIT=$(find . -type f -path '*nixos-system*/init'))
cd /real-root
mkdir old_root
mount --make-rprivate /
pivot_root . old_root
$INIT
  1. Now you’re in the livecd environment (ish), proceed to do your installation :slight_smile:. This worked for me when I needed to reinstall NixOS on a Kimsufi box today.

This approach doesn’t work if your filesystem or something else needs kernel modules that the Kimsufi rescue system doesn’t provide. If that is the case, you’ll need to create a NixOS chroot that you can kexec into, so that you get the NixOS kernel as well.

See https://github.com/nix-community/nixos-generators and https://github.com/cleverca22/nix-tests/tree/master/kexec for some existing sources on the kexec approach.

2 Likes