You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Container private networking not working when hardened profile is enabled #38676
$ sudo nixos-container start gitlab
Job for [email protected] failed because the control process exited with error code.
See "systemctl status [email protected]" and "journalctl -xe" for details.
/run/current-system/sw/bin/nixos-container: failed to start container
$ systemctl status [email protected]
Failed to add new veth interfaces (ve-gitlab:host0): Operation not supported
... failed
I cannot reproduce this on my system with same nixos revision 18.03.131807.489a14add9a and your container config from above. Container starts and networking looks fine. Does your system have any kind of special network setup?
changed the title [-]Container private networking not working[/-][+]Container private networking not working when hardened profile is enabled[/+]on Apr 10, 2018
Don't understand why yet, but adding security.lockKernelModules = false; to the host config seems to fix it. Hardened profile sets this to true by default.
I think a better solution will be to have the container module load all kernel modules required for private networking at boot time. Let's keep the issue open while I give that a try.
Adding boot.kernelModules = [ "veth" ]; seems to fix the issue. I see that at least start and root-login is working, but am not sure about other things.
Hello ! I stumbled upon this issue while trying to add a container with a private network, so I'm not sure this issue is resolved: I still had to add boot.kernelModules = [ "veth" ]; as @yvt suggested, which fixed the container startup.
Hello ! I stumbled upon this issue while trying to add a container with a private network, so I'm not sure this issue is resolved: I still had to add boot.kernelModules = [ "veth" ]; as @yvt suggested, which fixed the container startup.
Activity
xeji commentedon Apr 10, 2018
I cannot reproduce this on my system with same nixos revision
18.03.131807.489a14add9aand your container config from above. Container starts and networking looks fine. Does your system have any kind of special network setup?andrewchambers commentedon Apr 10, 2018
Whole config below :
Only things that look interesting to me are virtualbox and perhaps the rkt service.
andrewchambers commentedon Apr 10, 2018
andrewchambers commentedon Apr 10, 2018
Ok, found the cause, was the hardened profile. Perhaps bpf is needed for virtual ethernet, will investigate some more.
[-]Container private networking not working[/-][+]Container private networking not working when hardened profile is enabled[/+]xeji commentedon Apr 10, 2018
Thanks. I never tried containers with the hardened profile. Will look into it.
xeji commentedon Apr 10, 2018
Don't understand why yet, but adding
security.lockKernelModules = false;to the host config seems to fix it. Hardened profile sets this totrueby default.@andrewchambers please check if this works for you.
andrewchambers commentedon Apr 11, 2018
@xeji confirmed after a reboot.
xeji commentedon Apr 11, 2018
I think a better solution will be to have the container module load all kernel modules required for private networking at boot time. Let's keep the issue open while I give that a try.
baracoder commentedon Nov 2, 2018
@xeji ping ;)
joachifm commentedon Nov 24, 2018
Module locking is quite heavy-handed. Loading all required modules before the lock is engaged is indeed the correct fix, if locking is desired.
yvt commentedon Oct 2, 2019
Adding
boot.kernelModules = [ "veth" ];seems to fix the issue. I see that at leaststartandroot-loginis working, but am not sure about other things.joachifm commentedon Oct 2, 2019
@yvt makes sense to me. If you care to, I'd be happy to integrate a PR to that effect.
nixos/containers: explicitly load kernel modules for networking
nixos/containers: explicitly load kernel modules for networking
minijackson commentedon Dec 19, 2021
Hello ! I stumbled upon this issue while trying to add a container with a private network, so I'm not sure this issue is resolved: I still had to add
boot.kernelModules = [ "veth" ];as @yvt suggested, which fixed the container startup.serpent213 commentedon Oct 25, 2023
Same here, still...