From e2e8fa5b72a63daf5d86b10b66b87edcdec2b311 Mon Sep 17 00:00:00 2001 From: MickLesk Date: Fri, 20 Feb 2026 21:08:14 +0100 Subject: [PATCH] fix(docker-vm): add error handling for virt-customize finalization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The hostname/machine-id virt-customize calls had no error handling, unlike the SSH config calls just below them which already use || true. When virt-customize fails (e.g. on certain Debian 13 images), the script aborted instead of continuing gracefully. These steps are not critical — Cloud-Init can set the hostname later. Closes #12073 --- vm/docker-vm.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vm/docker-vm.sh b/vm/docker-vm.sh index b4de65d94..1e745dd98 100644 --- a/vm/docker-vm.sh +++ b/vm/docker-vm.sh @@ -525,9 +525,9 @@ fi msg_info "Finalizing image (hostname, SSH config)" # Set hostname and prepare for unique machine-id -virt-customize -q -a "$WORK_FILE" --hostname "${HN}" >/dev/null 2>&1 -virt-customize -q -a "$WORK_FILE" --run-command "truncate -s 0 /etc/machine-id" >/dev/null 2>&1 -virt-customize -q -a "$WORK_FILE" --run-command "rm -f /var/lib/dbus/machine-id" >/dev/null 2>&1 +virt-customize -q -a "$WORK_FILE" --hostname "${HN}" >/dev/null 2>&1 || true +virt-customize -q -a "$WORK_FILE" --run-command "truncate -s 0 /etc/machine-id" >/dev/null 2>&1 || true +virt-customize -q -a "$WORK_FILE" --run-command "rm -f /var/lib/dbus/machine-id" >/dev/null 2>&1 || true # Configure SSH for Cloud-Init if [ "$USE_CLOUD_INIT" = "yes" ]; then