From dc42460d82387858d1dad0afe9b91ecd64665221 Mon Sep 17 00:00:00 2001 From: Finn Callies Date: Mon, 22 Jun 2026 07:47:14 +0200 Subject: [PATCH] scripts/pvics: Fix virt-resize permission error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Although the script is to be run with root privileges virt-resize starts as user qemu under the hood which depending on image location may cause permission errors. To fix this use `LIBGUESTFS_BACKEND=direct`. Reviewed-by: Holger Dengler Signed-off-by: Finn Callies Signed-off-by: Jan Höppner --- scripts/pvics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pvics b/scripts/pvics index fa8c5652..92347172 100755 --- a/scripts/pvics +++ b/scripts/pvics @@ -1329,7 +1329,7 @@ encrypt() { # Increase partition size by 32MiB as well, but not the file system, as the LUKS2 encryption is around the filesystem image_resized="${TEMP_DIR}/resized.qcow2" execute cp "${image}" "${image_resized}" - execute virt-resize --expand "/dev/vda${ROOT_PARTNUM}" --no-expand-content "${image}" "${image_resized}" + execute env -S LIBGUESTFS_BACKEND=direct virt-resize --expand "/dev/vda${ROOT_PARTNUM}" --no-expand-content "${image}" "${image_resized}" # Remove smaller image, as we already made a copy execute rm -f "${image}" image="${image_resized}"