Hello! I am currently setting up a Raspberry Pi 3B, and after getting it up and running, I wanted to rebuild its configuration. I quickly ran into the rebuild being too slow and not having enough RAM, so I decided to try doing a remote rebuild from my main PC following the recommendations in this answer: Nix-rebuild too slow on Raspberry Pi 3B+ - #6 by Nebucatnetzer
I ran the command sudo nixos-rebuild --target-host admin@xx.xx.xx.xx --sudo --flake .#pix boot, and while it started of strong and started fetching and building some things, it afterwards failed with âerror: this system does not support the kernel namespaces that are required for sandboxing; use ââno-sandboxâ to disable sandboxingâ
What could be causing this issue?
More context:
My main machine is x86_64 and the target machine (being a Raspberry Pi 3B) is aarch64. I do have boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; enabled on my main machine to be able to build packages for the pi. I was able to build an SD card image for the raspberry pi earlier on my main machine, so that should (if I understand correctly) confirm that I am able to build aarch64 packages.
$ sudo nixos-rebuild --target-host admin@192.168.0.120 --sudo --flake .#pix boot
[sudo] password for emerald:
warning: creating lock file "/home/emerald/Raspberry/flake.lock":
⢠Added input 'nixpkgs':
'github:nixos/nixpkgs/2fad6eac6077f03fe109c4d4eb171cf96791faa4?narHash=sha256-sKoIWfnijJ0%2B9e4wRvIgm/HgE27bzwQxcEmo2J/gNpI%3D' (2025-11-27)
building the system configuration...
error: this system does not support the kernel namespaces that are required for sandboxing; use '--no-sandbox' to disable sandboxing
Command 'nix --extra-experimental-features 'nix-command flakes' build --print-out-paths '.#nixosConfigurations."pix".config.system.build.toplevel' --no-link' returned non-zero exit status 1.
Itâs not a lot. If there is some kind of argument that I can add to make the command print more info during execution, please tell me!
Posting the config that I am trying to build for the Raspberry Pi might be helpful too:
# configuration.nix
{ config, lib, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
boot.loader.grub.enable = false;
# Enables the generation of /boot/extlinux/extlinux.conf
boot.loader.generic-extlinux-compatible.enable = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
... # Some less relevant parts excluded
# Define a user account.
users.users.admin = {
hashedPassword = "...";
isNormalUser = true;
extraGroups = [ "wheel" ];
};
... # Some less relevant parts excluded
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Auto generated via "sudo nixos-generate-config"
system.stateVersion = "26.05";
}
So what I do is that I also include the hardware settings from nixos-hardware specific for the pi but I doubt that this solves your error. From first glance I donât see anything else wrong with your config.
I just tried adding that, and it unfortunately did not help
It must be an issue with the config on my main computer then. Could you possibly share anything and everything that could in any way be related to this, from your main computers config? Maybe there is some option that you have enabled that I do not
It worked! However, important quirk to mention is that you canât add ââno-sandboxâ directly to nixos-rebuild, but instead to the raw build command: sudo nix --extra-experimental-features 'nix-command flakes' build --no-sandbox --print-out-paths '.#nixosConfigurations."pix".config.system.build.toplevel' --no-link, as the error message suggest.
This successfully builds the system, and after that I was able to run the previous command sudo nixos-rebuild --target-host admin@192.168.0.120 --sudo --ask-sudo-password --flake .#pix boot to send it over to the Raspberry Pi! It didnât error this time, as the system was already built, so no extra building was needed.
I now have a Raspberry Pi 3B running my config, but, I am not quite satisfied yet. Iâm not very happy with the fact that I had to do this workaround! Itâs first of all unnecessary friction, and secondly, sandboxing sounds quite important. I therefore donât consider this problem completely solved yet. And on the topic of sandboxing: What does it even do?
Thank you! I have read that issue already, but it wasnât of much use as I, to be brutally honest, didnât understand a thing in it. I simply havenât used nix for long enough to know what they are talking about
That does however give me an idea: Hi @johnrichardrinehart@NobbZ, as the main brains behind figuring out that issue (which I assume is at least somewhat related to my issue), would you guys be able to lend a hand here? Do you have any clue what my issue could be related to? Iâd be happy to provide any relevant parts from my main config if that helps!
This issue sounds really familiar. Is your x86 cpu fairly old by any chance?
I think I had the same issue when cross building for a RPI3 and the cause might have been my aging cpu (i7-3770K). It was a long time ago I couldnât explain you why but it would be consistent with @eblechschmidt not being able to reproduce.
Yeah, I agree that it probably isnât the same issue as the one linked. Still, the symptom is similar, and your knowledge of it is the best that we have. So, do you by any chance know where I should be digging to hopefully find a solution? I really just need to get an idea of where to start haha
I âunfortunatelyâ have a somewhat new processor. My main computer has a i7-7700, and I also tried doing the same steps on my laptop with a very new i5-1334U - getting the same error.
When you were getting the error on your computer with an older CPU, did you also try it on a different computer and got a success, or did you just try it on that one?
Oo wait, Iâve read that sandboxing might work a bit differently depending on the platform. If you are using MacOS / a MacBook, that could be the main difference here!
Could you run the command nixos-option -r nix.settings and send me the values of the following options (pretty much anything related to building, the system, or sandboxing):
The above are my values. Could be interesting to see if there are any differences! Also, if it prints any option that has the word âsandboxâ in it that I havenât added above, please add it, as it seems to not print options that arenât set to anything.