fix: Boot order syntax error, use pve-storage ISOs instead of downloading
This commit is contained in:
parent
8689184060
commit
2fbc8211ff
|
|
@ -154,40 +154,27 @@ log "✅ Pre-flight checks complete!"
|
|||
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"
|
||||
mkdir -p "$ISO_DIR"
|
||||
|
||||
# Ubuntu 22.04 Server ISO
|
||||
UBUNTU_ISO="$ISO_DIR/ubuntu-22.04.5-live-server-amd64.iso"
|
||||
# Ubuntu ISO (use 24.04.3 from pve-storage)
|
||||
UBUNTU_ISO="/mnt/pve/pve-storage/template/iso/ubuntu-24.04.3-live-server-amd64.iso"
|
||||
if [ -f "$UBUNTU_ISO" ]; then
|
||||
log "✓ Ubuntu ISO found"
|
||||
log "✓ Ubuntu 24.04.3 ISO found in pve-storage"
|
||||
else
|
||||
log "⬇️ Downloading Ubuntu 22.04 Server ISO..."
|
||||
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"
|
||||
error "Ubuntu ISO not found in pve-storage. Please ensure ubuntu-24.04.3-live-server-amd64.iso exists."
|
||||
fi
|
||||
|
||||
# Check for Windows ISO
|
||||
WIN_ISO="$ISO_DIR/Win11_IoT_Enterprise_LTSC.iso"
|
||||
WIN_ISO_ALT="$ISO_DIR/Win11.iso"
|
||||
# Windows ISO
|
||||
WIN_ISO="/mnt/pve/pve-storage/template/iso/Win11_IoT_Enterprise_LTSC.iso"
|
||||
|
||||
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"
|
||||
elif [ -f "$WIN_ISO_ALT" ]; then
|
||||
log "✓ Windows 11 ISO found"
|
||||
WIN_ISO_FILE="Win11.iso"
|
||||
else
|
||||
warn "⚠️ Windows ISO not found"
|
||||
info "Please download Windows 11 ISO and place it in:"
|
||||
info " $ISO_DIR/Win11.iso"
|
||||
info "Download from: https://www.microsoft.com/software-download/windows11"
|
||||
warn "⚠️ Windows ISO not found in pve-storage"
|
||||
info "Expected: Win11_IoT_Enterprise_LTSC.iso"
|
||||
read -p "Press Enter when Windows ISO is ready (or 'skip' to continue without): " response
|
||||
if [ "$response" == "skip" ]; then
|
||||
WIN_ISO_FILE=""
|
||||
|
|
@ -228,10 +215,10 @@ qm set $MAIN_VMID \
|
|||
qm set $MAIN_VMID --ide2 ${STORAGE_HDD}:cloudinit,media=cdrom
|
||||
|
||||
# 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
|
||||
qm set $MAIN_VMID --boot order=scsi0;ide0
|
||||
qm set $MAIN_VMID --boot "order=scsi0;ide0"
|
||||
|
||||
# Enable QEMU Guest Agent
|
||||
qm set $MAIN_VMID --agent enabled=1,fstrim_cloned_disks=1
|
||||
|
|
@ -286,13 +273,13 @@ qm set $WIN_VMID \
|
|||
|
||||
# Attach Windows ISO if available
|
||||
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
|
||||
warn "No Windows ISO attached. Attach manually later."
|
||||
fi
|
||||
|
||||
# Boot order
|
||||
qm set $WIN_VMID --boot order=scsi0;ide0
|
||||
qm set $WIN_VMID --boot "order=scsi0;ide0"
|
||||
|
||||
# Enable QEMU Guest Agent
|
||||
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
|
||||
|
||||
# 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
|
||||
qm set $ANDROID_VMID --boot order=scsi0;ide0
|
||||
qm set $ANDROID_VMID --boot "order=scsi0;ide0"
|
||||
|
||||
# Enable QEMU Guest Agent
|
||||
qm set $ANDROID_VMID --agent enabled=1
|
||||
|
|
|
|||
Loading…
Reference in New Issue