Enable snapshot support in run_vm_bios.sh with automatic detection

This commit is contained in:
2026-02-09 15:14:09 +01:00
parent 59219130bd
commit e8afc31d00

View File

@@ -3,18 +3,34 @@
# Configuration
ISO_PATH="${1:-/home/n0va/.local/share/iridium-installer-vm/Fedora.iso}"
DISK_PATH="${2:-/home/n0va/.local/share/iridium-installer-vm/test-disk.qcow2}"
SNAPSHOT_NAME="clean-state"
if [ ! -f "$ISO_PATH" ]; then
echo "Error: ISO not found at $ISO_PATH"
exit 1
fi
if [ ! -f "$DISK_PATH" ]; then
echo "Error: Disk image not found at $DISK_PATH"
exit 1
fi
echo "Starting Iridium VM with BIOS (Legacy) support..."
echo "ISO: $ISO_PATH"
echo "Disk: $DISK_PATH"
# Check if snapshot exists
LOADVM_ARG=""
if qemu-img info "$DISK_PATH" | grep -q " $SNAPSHOT_NAME$"; then
echo "Found snapshot '$SNAPSHOT_NAME', loading..."
LOADVM_ARG="-loadvm $SNAPSHOT_NAME"
else
echo "Snapshot '$SNAPSHOT_NAME' not found. Starting from fresh disk state."
fi
# QEMU Command with BIOS
# Using -device ide-cd for better compatibility in some environments
# Note: For snapshots to work reliably, all writable disks must be qcow2.
# The ISO is raw but readonly=on, which is compatible.
qemu-system-x86_64 \
-enable-kvm \
-m 8G \
@@ -30,4 +46,5 @@ qemu-system-x86_64 \
-vga virtio \
-display gtk,gl=on \
-monitor unix:$HOME/.local/share/iridium-installer-vm/monitor.sock,server,nowait \
-name "Iridium Installer Test VM (BIOS)"
-name "Iridium Installer Test VM (BIOS)" \
$LOADVM_ARG