From b35437c3915263385e81a79723fe9656d74e90b7 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Wed, 28 Jan 2026 14:44:00 +0100 Subject: [PATCH] fix(build): fix Debian 13 root ownership from host before customization --- misc/build.func | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/misc/build.func b/misc/build.func index 8bcf5bb79..03868129a 100644 --- a/misc/build.func +++ b/misc/build.func @@ -3878,6 +3878,17 @@ EOF fix_gpu_gids + # Fix Debian 13 LXC template bug where / is owned by nobody:nogroup + # This must be done from the host as unprivileged containers cannot chown / + local rootfs + rootfs=$(pct config "$CTID" | grep -E '^rootfs:' | sed 's/rootfs: //' | cut -d',' -f1) + if [[ -n "$rootfs" ]]; then + local mount_point="/var/lib/lxc/${CTID}/rootfs" + if [[ -d "$mount_point" ]] && [[ "$(stat -c '%U' "$mount_point")" != "root" ]]; then + chown root:root "$mount_point" 2>/dev/null || true + fi + fi + # Continue with standard container setup msg_info "Customizing LXC Container"