From 60af7d8a0effb6c44f8dae5c084360af4e9054c2 Mon Sep 17 00:00:00 2001 From: bdnugget Date: Fri, 19 Sep 2025 15:38:06 +0200 Subject: [PATCH] QEMU script --- qemuselect.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 qemuselect.sh diff --git a/qemuselect.sh b/qemuselect.sh new file mode 100755 index 0000000..d18c37f --- /dev/null +++ b/qemuselect.sh @@ -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 +