fix: Boot order syntax error, use pve-storage ISOs instead of downloading

This commit is contained in:
devmatrix 2026-02-16 14:28:30 +00:00
parent 8689184060
commit 2fbc8211ff
1 changed files with 17 additions and 30 deletions

View File

@ -154,40 +154,27 @@ log "✅ Pre-flight checks complete!"
echo "" echo ""
# ============================================ # ============================================
# DOWNLOAD ISO IMAGES # CHECK ISO IMAGES (in pve-storage)
# ============================================ # ============================================
log "⬇️ Checking for ISO images..." log "⬇️ Checking for ISO images in pve-storage..."
ISO_DIR="/var/lib/vz/template/iso" # Ubuntu ISO (use 24.04.3 from pve-storage)
mkdir -p "$ISO_DIR" UBUNTU_ISO="/mnt/pve/pve-storage/template/iso/ubuntu-24.04.3-live-server-amd64.iso"
# Ubuntu 22.04 Server ISO
UBUNTU_ISO="$ISO_DIR/ubuntu-22.04.5-live-server-amd64.iso"
if [ -f "$UBUNTU_ISO" ]; then if [ -f "$UBUNTU_ISO" ]; then
log "✓ Ubuntu ISO found" log "✓ Ubuntu 24.04.3 ISO found in pve-storage"
else else
log "⬇️ Downloading Ubuntu 22.04 Server ISO..." error "Ubuntu ISO not found in pve-storage. Please ensure ubuntu-24.04.3-live-server-amd64.iso exists."
wget -O "$UBUNTU_ISO" \
"https://releases.ubuntu.com/22.04/ubuntu-22.04.5-live-server-amd64.iso" \
--progress=bar:force 2>&1 | tail -f -n +6
log "✓ Ubuntu ISO downloaded"
fi fi
# Check for Windows ISO # Windows ISO
WIN_ISO="$ISO_DIR/Win11_IoT_Enterprise_LTSC.iso" WIN_ISO="/mnt/pve/pve-storage/template/iso/Win11_IoT_Enterprise_LTSC.iso"
WIN_ISO_ALT="$ISO_DIR/Win11.iso"
if [ -f "$WIN_ISO" ]; then if [ -f "$WIN_ISO" ]; then
log "✓ Windows LTSC IoT ISO found" log "✓ Windows IoT Enterprise LTSC ISO found"
WIN_ISO_FILE="Win11_IoT_Enterprise_LTSC.iso" WIN_ISO_FILE="Win11_IoT_Enterprise_LTSC.iso"
elif [ -f "$WIN_ISO_ALT" ]; then
log "✓ Windows 11 ISO found"
WIN_ISO_FILE="Win11.iso"
else else
warn "⚠️ Windows ISO not found" warn "⚠️ Windows ISO not found in pve-storage"
info "Please download Windows 11 ISO and place it in:" info "Expected: Win11_IoT_Enterprise_LTSC.iso"
info " $ISO_DIR/Win11.iso"
info "Download from: https://www.microsoft.com/software-download/windows11"
read -p "Press Enter when Windows ISO is ready (or 'skip' to continue without): " response read -p "Press Enter when Windows ISO is ready (or 'skip' to continue without): " response
if [ "$response" == "skip" ]; then if [ "$response" == "skip" ]; then
WIN_ISO_FILE="" WIN_ISO_FILE=""
@ -228,10 +215,10 @@ qm set $MAIN_VMID \
qm set $MAIN_VMID --ide2 ${STORAGE_HDD}:cloudinit,media=cdrom qm set $MAIN_VMID --ide2 ${STORAGE_HDD}:cloudinit,media=cdrom
# Attach Ubuntu ISO # Attach Ubuntu ISO
qm set $MAIN_VMID --ide0 local:iso/ubuntu-22.04.5-live-server-amd64.iso,media=cdrom qm set $MAIN_VMID --ide0 pve-storage:iso/ubuntu-24.04.3-live-server-amd64.iso,media=cdrom
# Boot order # Boot order
qm set $MAIN_VMID --boot order=scsi0;ide0 qm set $MAIN_VMID --boot "order=scsi0;ide0"
# Enable QEMU Guest Agent # Enable QEMU Guest Agent
qm set $MAIN_VMID --agent enabled=1,fstrim_cloned_disks=1 qm set $MAIN_VMID --agent enabled=1,fstrim_cloned_disks=1
@ -286,13 +273,13 @@ qm set $WIN_VMID \
# Attach Windows ISO if available # Attach Windows ISO if available
if [ -n "$WIN_ISO_FILE" ]; then if [ -n "$WIN_ISO_FILE" ]; then
qm set $WIN_VMID --ide0 local:iso/${WIN_ISO_FILE},media=cdrom qm set $WIN_VMID --ide0 pve-storage:iso/Win11_IoT_Enterprise_LTSC.iso,media=cdrom
else else
warn "No Windows ISO attached. Attach manually later." warn "No Windows ISO attached. Attach manually later."
fi fi
# Boot order # Boot order
qm set $WIN_VMID --boot order=scsi0;ide0 qm set $WIN_VMID --boot "order=scsi0;ide0"
# Enable QEMU Guest Agent # Enable QEMU Guest Agent
qm set $WIN_VMID --agent enabled=1 qm set $WIN_VMID --agent enabled=1
@ -333,10 +320,10 @@ qm set $ANDROID_VMID \
--scsi0 ${STORAGE_HDD}:${ANDROID_DISK},format=qcow2,cache=writeback,discard=on,iothread=1,ssd=1 --scsi0 ${STORAGE_HDD}:${ANDROID_DISK},format=qcow2,cache=writeback,discard=on,iothread=1,ssd=1
# Attach Ubuntu ISO (for Android dev environment setup) # Attach Ubuntu ISO (for Android dev environment setup)
qm set $ANDROID_VMID --ide0 local:iso/ubuntu-22.04.5-live-server-amd64.iso,media=cdrom qm set $ANDROID_VMID --ide0 pve-storage:iso/ubuntu-24.04.3-live-server-amd64.iso,media=cdrom
# Boot order # Boot order
qm set $ANDROID_VMID --boot order=scsi0;ide0 qm set $ANDROID_VMID --boot "order=scsi0;ide0"
# Enable QEMU Guest Agent # Enable QEMU Guest Agent
qm set $ANDROID_VMID --agent enabled=1 qm set $ANDROID_VMID --agent enabled=1