QEMU script

This commit is contained in:
2025-09-19 15:38:06 +02:00
parent 4522ce9da7
commit 60af7d8a0e

29
qemuselect.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
ISO_DIR="$HOME/Documents/HogelandLinux/LinuxDistros"
ISO_LIST=("$ISO_DIR"/*.iso)
# Bail out if no ISOs
if [ ${#ISO_LIST[@]} -eq 0 ]; then
echo "No ISO files found in $ISO_DIR"
exit 1
fi
PS3="Select a distro to boot with QEMU (or Ctrl+C to quit): "
select iso in "${ISO_LIST[@]}"; do
if [ -n "$iso" ]; then
echo "Launching $iso ..."
qemu-system-x86_64 \
-m 2048 \
-cdrom "$iso" \
-boot d \
-enable-kvm \
-cpu host \
-smp 2
break
else
echo "Invalid choice."
fi
done