Hi,
I'm trying to run nixos under lxc. I've used
this and
this as references and managed to get image obtained from Hydra up and running under lxc. However it seems that I can't do anything useful with it cause "nixos-rebuild switch" command fails with the following output:
[root@nixos:~]# nixos-rebuild switch
building Nix...
building the system configuration...
activating the configuration...
setting up /etc...
mount: /dev: permission denied.
mount: /dev/pts: permission denied.
mount: /dev/shm: permission denied.
mount: /proc: permission denied.
mount: /run: permission denied.
mount: /run/keys: permission denied.
mount: /run/wrappers: permission denied.
setting up tmpfiles
warning: the following units failed: sys-kernel-config.mount
● sys-kernel-config.mount - Kernel Configuration File System
Loaded: loaded (/nix/store/fl3mcaqqk2vg0dmk01dfbs6nbm5skpzc-systemd-237/example/systemd/system/sys-kernel-config.mount; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2018-05-04 17:47:56 UTC; 21ms ago
Where: /sys/kernel/config
What: configfs
Docs:
https://www.kernel.org/doc/Documentation/filesystems/configfs/configfs.txt https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems Process: 915 ExecMount=/nix/store/xnyix1xsidcddhh2ry6jxnpgysjsl4qn-util-linux-2.31.1-bin/bin/mount configfs /sys/kernel/config -t configfs (code=exited, status=32)
May 04 17:47:56 nixos systemd[1]: Mounting Kernel Configuration File System...
May 04 17:47:56 nixos mount[915]: mount: /sys/kernel/config: permission denied.
May 04 17:47:56 nixos systemd[1]: sys-kernel-config.mount: Mount process exited, code=exited status=32
May 04 17:47:56 nixos systemd[1]: sys-kernel-config.mount: Failed with result 'exit-code'.
May 04 17:47:56 nixos systemd[1]: Failed to mount Kernel Configuration File System.
warning: error(s) occurred while switching to the new configuration
Disabling sys-kernel-config.mount via /etc/nixos/configuration.nix didn't help either.I believe that the problem is somehow related to
those "permission denied" errors but not really sure about that.
Does anybody have any positive experience with running nixos under unprivileged lxc? Are there any well-known obstacles preventing this usecase? I'm nix(os) newbie and might simply be unaware of them ;)
Any help would be greatly appreciated. Thanks in advance!