40 lines
1.3 KiB
Bash
Executable File
40 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Configuration
|
|
ISO_PATH="${1:-/home/n0va/Downloads/Fedora-Workstation-Live-43-1.6.x86_64.iso}"
|
|
DISK_PATH="${2:-/home/n0va/.local/share/iridium-installer-vm/test-disk.qcow2}"
|
|
OVMF_CODE="/usr/share/edk2/x64/OVMF_CODE.4m.fd"
|
|
OVMF_VARS_TEMPLATE="/usr/share/edk2/x64/OVMF_VARS.4m.fd"
|
|
OVMF_VARS_LOCAL="/tmp/iridium_vm_vars.fd"
|
|
|
|
# Ensure OVMF vars exist
|
|
if [ ! -f "$OVMF_VARS_LOCAL" ]; then
|
|
if [ -f "$OVMF_VARS_TEMPLATE" ]; then
|
|
cp "$OVMF_VARS_TEMPLATE" "$OVMF_VARS_LOCAL"
|
|
else
|
|
echo "Warning: OVMF VARS template not found at $OVMF_VARS_TEMPLATE"
|
|
fi
|
|
fi
|
|
|
|
echo "Starting Iridium VM with UEFI support..."
|
|
echo "ISO: $ISO_PATH"
|
|
echo "Disk: $DISK_PATH"
|
|
|
|
# QEMU Command with UEFI (OVMF) enabled
|
|
qemu-system-x86_64 \
|
|
-enable-kvm \
|
|
-m 4G \
|
|
-smp 2 \
|
|
-cpu host \
|
|
-drive if=pflash,format=raw,readonly=on,file="$OVMF_CODE" \
|
|
-drive if=pflash,format=raw,file="$OVMF_VARS_LOCAL" \
|
|
-drive file="$DISK_PATH",format=qcow2,if=virtio \
|
|
-cdrom "$ISO_PATH" \
|
|
-boot once=d \
|
|
-netdev user,id=net0 \
|
|
-device virtio-net-pci,netdev=net0 \
|
|
-vga virtio \
|
|
-display gtk,gl=on \
|
|
-monitor unix:$HOME/.local/share/iridium-installer-vm/monitor.sock,server,nowait \
|
|
-name "Iridium Installer Test VM (UEFI)" \
|
|
# -loadvm clean-state |