From e6c76038641523bbc8134593b6dc43967e76f95c Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Mon, 4 Oct 2021 17:49:37 +0100 Subject: [PATCH] Tweak DISPLAY_DEVICE based on macOS release Do not try and coerce the screen resolution on macOS. Resolution is defined via System Preferences only on macOS. qxl is the display device on Catalina and Big Sur and VGA is used on Mahave and High Sierra. bochs-display also appears to work correctly on Big Sur providing the QEMU moniotor is set to none, which Quickemu does by default. --- quickemu | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/quickemu b/quickemu index bd70b60..b65bc2f 100755 --- a/quickemu +++ b/quickemu @@ -397,14 +397,25 @@ function vm_boot() { fi fi - echo " - Screen: ${X_RES}x${Y_RES}" + if [ "${guest_os}" != "macos" ]; then + echo " - Screen: ${X_RES}x${Y_RES}" + fi echo " - Display: ${OUTPUT^^}" # https://www.kraxel.org/blog/2019/09/display-devices-in-qemu/ if [ "${guest_os}" == "linux" ]; then DISPLAY_DEVICE="virtio-vga" elif [ "${guest_os}" == "macos" ]; then - DISPLAY_DEVICE="qxl" + # Tweak video device based on the guest macOS release. + # Displays in System Preferences can be used to select a resolution if: + # - qxl is used on Big Sur and Catalina + # - VGA is used on Mojave, although options are limited and they are all 4:3 + # - High Sierra will run at the default 1920x1080 only. + case ${macos_release} in + catalina) DISPLAY_DEVICE="qxl";; + big-sur) DISPLAY_DEVICE="qxl";; + *) DISPLAY_DEVICE="VGA";; + esac elif [ "${guest_os}" == "windows" ]; then DISPLAY_DEVICE="qxl-vga" else @@ -412,9 +423,6 @@ function vm_boot() { fi if [ "${OUTPUT}" == "spice" ]; then - if [ "${guest_os}" == "linux" ]; then - DISPLAY_DEVICE="qxl-vga" - fi OUTPUT="none" fi