fix: remove qemu-utils from installer + configurable storage path

1. Removed qemu-utils from required packages — Proxmox ships its own
   qemu-img and installing Debian's version breaks VMs. Added preflight
   check: if qemu-img missing, exits with clear error message.

2. Installer now prompts for host storage path (default:
   /mnt/pve/hosted-thin). Uses it for the LXC bind mount mp0.
   The LXC always sees /mnt/converter internally — no symlinks needed.
This commit is contained in:
root 2026-07-25 11:23:26 +00:00
parent b33ab1605e
commit ef2d74a62b

View file

@ -48,6 +48,10 @@ if ! command -v git &>/dev/null; then
echo " Installing git..."
apt-get update -qq && apt-get install -y -qq git
fi
if ! command -v qemu-img &>/dev/null; then
echo " ${RED}${NC} 'qemu-img' not found — Proxmox ships this. Do NOT install qemu-utils (conflicts with Proxmox)."
exit 1
fi
echo " ${GREEN}${NC} Running on Proxmox host."
# ───────────────────────────────────────────────────────────────────
@ -105,11 +109,10 @@ PACKAGES=()
REQUIRED=(
python3 "python3"
python3-pip "pip3"
qemu-utils "qemu-img"
libguestfs-tools "guestfish"
p7zip-full "7z"
unzip "unzip"
unrar-free "unrar"
unrar-free "unrar"
tar "tar"
gzip "gunzip"
bzip2 "bunzip2"
@ -216,6 +219,23 @@ CT_MAC="${CT_MAC:-BC:24:11:80:5A:B1}"
NET_CFG="name=eth0,bridge=${CT_BRIDGE},firewall=1,gw=${CT_GW},hwaddr=${CT_MAC},ip=${CT_IP},type=veth"
ROOTFS="local-lvm:vm-${CTID}-disk-0,size=24G"
# ── Storage path ──────────────────────────────────────────────────
echo ""
echo " ${CYAN}Storage mount:${NC}"
echo " Path on the Proxmox host where VM Bench stores its data."
echo " The LXC will see this as /mnt/converter internally."
read -p " Host storage path [/mnt/pve/hosted-thin]: " STORAGE_PATH
STORAGE_PATH="${STORAGE_PATH:-/mnt/pve/hosted-thin}"
# Remove trailing slash
STORAGE_PATH="${STORAGE_PATH%/}"
# Create the directory on the host if it doesn't exist
if [ ! -d "$STORAGE_PATH" ]; then
echo " Creating: $STORAGE_PATH"
mkdir -p "$STORAGE_PATH"
fi
# ── Template selection ────────────────────────────────────────────
echo ""
echo " ${CYAN}Available Debian templates:${NC}"
@ -260,7 +280,7 @@ pct create "$CTID" "$TEMPLATE" \
--swap 2048 \
--unprivileged 0 \
--features nesting=1 \
--mp0 /mnt/converter,mp=/mnt/converter \
--mp0 ${STORAGE_PATH},mp=/mnt/converter \
--onboot 1 \
--start 0