tfc / nspawn-nixos

Accompanying Code for Nixcademy.com Blog Article
https://nixcademy.com/2023/08/29/nixos-nspawn/
41 stars 6 forks source link

can't rebuild system due to lack of kernel sandboxing #5

Closed zarkone closed 3 months ago

zarkone commented 3 months ago

after getting system running inside of container, I've adjusted the configuration of "configuration.nix" and tried to rebuild the system:

$ nixos-rebuild switch
error: this system does not support the kernel namespaces that are required for sandboxing; use '--no-sandbox' to disable sandboxing

not sure if I'm missing something obvious here..?

chuck-r commented 3 months ago

I started trying to use NixOS about a year ago and ran into this roadblock as well. Sure, I can run it in a VM, but I want to use a container because it has fewer resource requirements. This roadblock caused me to give up NixOS entirely until this week. And, here I am again at this dead end. As a temporary fix, you can add the following to your /etc/nixos/configuration.nix:

nix.settings.use-sandbox = false;

However, I have no idea what the ramifications of that change are.

zarkone commented 3 months ago

thanks @chuck-r ! will check this out :+1: