lxc patch 10

This commit is contained in:
2026-04-11 10:50:16 -04:00
parent 6cd706b33d
commit 665b5679e4
2 changed files with 10 additions and 2 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ fi
lxc-start -n "$CONTAINER" 2>/dev/null || true lxc-start -n "$CONTAINER" 2>/dev/null || true
if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then
exec lxc-attach -n "$CONTAINER" -- /bin/bash -c "export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin; $SSH_ORIGINAL_COMMAND" exec sudo lxc-attach --clear-env -n "$CONTAINER" -- /bin/bash -c "export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin; $SSH_ORIGINAL_COMMAND"
else else
exec lxc-attach -n "$CONTAINER" -- /bin/login -f root exec sudo lxc-attach --clear-env -n "$CONTAINER" -- /bin/login -f root
fi fi
+8
View File
@@ -5,6 +5,14 @@
lxcfs.enable = true; lxcfs.enable = true;
}; };
security.sudo.extraRules = [{
groups = [ "labmates" ];
commands = [
{ command = "/run/current-system/sw/bin/lxc-attach"; options = [ "NOPASSWD" ]; }
{ command = "/run/current-system/sw/bin/lxc-start"; options = [ "NOPASSWD" ]; }
];
}];
networking.networkmanager.unmanaged = [ "br0" ]; networking.networkmanager.unmanaged = [ "br0" ];
virtualisation.lxc.defaultConfig = '' virtualisation.lxc.defaultConfig = ''