-
-
Notifications
You must be signed in to change notification settings - Fork 585
Description
I confirm this bug has not already been reported
- I have searched the issues and this bug has not been reported previously
Describe the bug
Posting this to gather opinions before trying to work on a PR to resolve.
Looking at the logic in quickget, it seems like as of e29173a, the default machine type is q35.
If we look at the case statement in quickget, several OSes are automatically configured with boot="legacy" in their config files:
Lines 1437 to 1512 in 6b51f74
| case ${OS} in | |
| alma|athenaos|centos-stream|endless|garuda|gentoo|kali|nixos|oraclelinux|popos|rockylinux) | |
| echo "disk_size=\"32G\"" >> "${CONF_FILE}";; | |
| openindiana) | |
| echo "boot=\"legacy\"" >> "${CONF_FILE}" | |
| echo "disk_size=\"32G\"" >> "${CONF_FILE}";; | |
| batocera) | |
| echo "disk_size=\"8G\"" >> "${CONF_FILE}";; | |
| bazzite) | |
| echo "disk_size=\"64G\"" >> "${CONF_FILE}";; | |
| dragonflybsd|haiku|openbsd|netbsd|slackware|slax|tails|tinycore) | |
| echo "boot=\"legacy\"" >> "${CONF_FILE}";; | |
| deepin) | |
| echo "disk_size=\"64G\"" >> "${CONF_FILE}" | |
| echo "ram=\"4G\"" >> "${CONF_FILE}" | |
| ;; | |
| freedos) | |
| echo "boot=\"legacy\"" >> "${CONF_FILE}" | |
| echo "disk_size=\"4G\"" >> "${CONF_FILE}" | |
| echo "ram=\"256M\"" >> "${CONF_FILE}" | |
| ;; | |
| kolibrios) | |
| echo "boot=\"legacy\"" >> "${CONF_FILE}" | |
| echo "disk_size=\"2G\"" >> "${CONF_FILE}" | |
| echo "ram=\"128M\"" >> "${CONF_FILE}" | |
| ;; | |
| slint) | |
| echo "disk_size=\"50G\"" >> "${CONF_FILE}" | |
| ;; | |
| slitaz) | |
| echo "boot=\"legacy\"" >> "${CONF_FILE}" | |
| echo "disk_size=\"4G\"" >> "${CONF_FILE}" | |
| echo "ram=\"512M\"" >> "${CONF_FILE}" | |
| ;; | |
| truenas-scale|truenas-core) | |
| echo "boot=\"legacy\"" >> "${CONF_FILE}" | |
| # the rest is non-functional | |
| # echo "bootdrive_size=\"5G\"" >> "${CONF_FILE}" # boot drive | |
| # echo "1stdrive_size=\"20G\"" >> "${CONF_FILE}" # for testing | |
| # echo "2nddrive_size=\"20G\"" >> "${CONF_FILE}" # again, for testing | |
| ;; | |
| ubuntu-server) | |
| # 22.04+ fails on LVM build if disk size is < 10G | |
| # 22.04.1 fails on auto-install if TPM is disabled | |
| echo "disk_size=\"10G\"" >> "${CONF_FILE}" | |
| echo "ram=\"4G\"" >> "${CONF_FILE}" | |
| if [[ "${RELEASE}" == *"22.04"* ]]; then | |
| echo "tpm=\"on\"" >> "${CONF_FILE}" | |
| fi | |
| ;; | |
| vanillaos) | |
| ## Minimum is 50G for abroot, but a 64GB is allocated to give some headroom | |
| echo "disk_size=\"64G\"" >> "${CONF_FILE}" | |
| ;; | |
| zorin) | |
| case ${EDITION} in | |
| education64|edulite64) echo "disk_size=\"32G\"" >> "${CONF_FILE}";; | |
| esac;; | |
| reactos) | |
| echo "boot=\"legacy\"" >> "${CONF_FILE}" | |
| echo "disk_size=\"12G\"" >> "${CONF_FILE}" | |
| echo "ram=\"2048M\"" >> "${CONF_FILE}" | |
| ;; | |
| macos) | |
| echo "disk_size=\"128G\"" >> "${CONF_FILE}" | |
| echo "macos_release=\"${RELEASE}\"" >> "${CONF_FILE}" | |
| # https://github.com/quickemu-project/quickemu/issues/438 | |
| if [ "${RELEASE}" == "monterey" ]; then | |
| echo "cpu_cores=2" >> "${CONF_FILE}" | |
| fi | |
| ;; | |
| proxmox-ve) | |
| echo "disk_size=\"20G\"" >> "${CONF_FILE}" | |
| echo "ram=\"4G\"" >> "${CONF_FILE}" | |
| ;; | |
| esac |
From what I can tell, that's this list:
- dragonflybsd
- freedos
- haiku
- kolibrios
- netbsd
- openbsd
- openindiana
- reactos
- slackware
- slax
- slitaz
- tails
- tinycore
- truenas-core
- truenas-scale
These legacy booting OSes are ones which presumably prefer booting in BIOS mode to EFI mode. But I don't see the logic in quickemu to fully match up with this. The configure_bios() function does a lot of stuff to deal with EFI OSes, but the logic for legacy boot OSes is mostly just to skip the section:
Lines 744 to 748 in 6b51f74
| else | |
| BOOT_STATUS="Legacy BIOS (${guest_os^})" | |
| boot="legacy" | |
| secureboot="off" | |
| fi |
Crucially, configuring legacy boot doesn't seem to change the MACHINE_TYPE away from the now-default of q35. The QEMU docs are a bit vague on whether q35 can actually boot in BIOS mode (https://www.qemu.org/docs/master/system/qemu-manpage.html#hxtool-8) and there are conflicting opinions online. But it's not something I've been able to get QEMU 10.x to do on Fedora, even by feeding in a SeaBIOS image using the -bios flag.
There are a select few distros in the above list which do get overridden to MACHINE_TYPE="pc" but those are ones which are specifically being booted in 32-bit mode also:
Lines 408 to 412 in 6b51f74
| case ${guest_os} in | |
| batocera|freedos|haiku|solaris) MACHINE_TYPE="pc";; | |
| kolibrios|reactos) | |
| CPU="-cpu qemu32" | |
| MACHINE_TYPE="pc";; |
Diffing that list with the list above, I think we get this list of distros for which the default quickget config may be broken:
- openindiana
- dragonflybsd
- openbsd (I think this is what's being seen in Can't run OpenBSD vm #1755)
- netbsd
- slackware
- slax
- tails
- tinycore
- slitaz
- truenas-scale
- truenas-core
I think maybe we need to update the logic in quickemu so that if boot="legacy" is set, the MACHINE_TYPE is automatically set to pc, but I'm looking for opinions on this before I try a PR. It's possible that this is something which only becomes an issue on more recent q35 revisions shipped with newer versions of QEMU since it seems odd that so many distros would have been broken in Quickemu for so long. But it's also possible I'm just missing something.
Edit: N.B. It might be worth reviewing the quickget legacy list anyway, since a few of those OSes can definitely boot in EFI mode - such as OpenBSD, and Tails (the latter of which actually even has full Secure Boot support).