From a9cc6234e87c7f2578baf50cf4a56b67f450c5a7 Mon Sep 17 00:00:00 2001 From: MickLesk Date: Fri, 26 Jun 2026 21:50:48 +0200 Subject: [PATCH] Fix bare-metal detection in iommu-setup systemd-detect-virt prints "none" on bare metal but exits non-zero, so the `|| echo "none"` fallback appended a second "none" and the check wrongly treated a physical Proxmox host as virtualized. Capture the command output directly and only block when a real virtualization type is reported. --- tools/pve/iommu-setup.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/pve/iommu-setup.sh b/tools/pve/iommu-setup.sh index 4194e2c9b..b96a1fb4a 100755 --- a/tools/pve/iommu-setup.sh +++ b/tools/pve/iommu-setup.sh @@ -52,8 +52,10 @@ if ! pveversion | grep -Eq "pve-manager/(8\.[0-4]|9\.[0-9]+)(\.[0-9]+)*"; then msg_error "Requires Proxmox Virtual Environment Version 8.0-8.4 or 9.x." exit 1 fi -virt=$(systemd-detect-virt 2>/dev/null || echo "none") -if [ "$virt" != "none" ]; then +# systemd-detect-virt prints "none" but exits non-zero on bare metal, so a +# `|| echo none` fallback would duplicate the value; capture output as-is. +virt=$(systemd-detect-virt 2>/dev/null) +if [ -n "$virt" ] && [ "$virt" != "none" ]; then msg_error "IOMMU/PCI passthrough must be configured on bare metal. Detected: $virt" exit 1 fi