From 352700197316be58a0a8b3aae84280972d75c163 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Tue, 28 Sep 2021 15:37:36 +0100 Subject: [PATCH] Add $virtio_blk to disable VirtIO Block Media Currently only required for macOS High Sierra and Mojave --- README.md | 4 +++- quickemu | 13 ++++++++++--- quickget | 7 +++++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 86ee50d..159c6cb 100644 --- a/README.md +++ b/README.md @@ -163,6 +163,8 @@ iso="${HOME}/Quickemu/macos-big-sur/disk.qcow2" ``` * The `guest_os="macos"` line instructs Quickemu to optimise for macOS. + * If you want to disable VirtIO Block Media and use SATA emulation add `virtio_blk="off"` to your configuration. + * `quickget` disables VirtIO Block Media for High Sierra and Mojave by default since it is not supported on those releases. ### macOS compatibility @@ -177,7 +179,7 @@ There are some considerations when running macOS via Quickemu. * Big Sur * Optimised by default * Host CPU vendor is detected and guest CPU configuration is optimised accordingly. - * [VirtIO block device](https://www.kraxel.org/blog/2019/06/macos-qemu-guest/) is used for the system disk (*available since macOS Mojave*). + * [VirtIO block device](https://www.kraxel.org/blog/2019/06/macos-qemu-guest/) is used for the system disk where supported. * [VirtIO `usb-tablet`](http://philjordan.eu/osx-virt/) is used for the mouse (*available since macOS El Capitan*). * `vmxnet3` network device is used (*available since macOS El Capitan*). * USB host pass-through is limited to UHCI (USB 2.0) diff --git a/quickemu b/quickemu index 81eb97f..efafa99 100755 --- a/quickemu +++ b/quickemu @@ -498,9 +498,15 @@ function vm_boot() { -device ide-hd,bus=ahci.1,drive=InstallMedia) fi - # shellcheck disable=SC2054,SC2206 - args+=(-drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}" - -device virtio-blk-pci,drive=SystemDisk,scsi=off ${STATUS_QUO}) + if [ "${virtio_blk}" == "on" ]; then + # shellcheck disable=SC2054 + args+=(-device virtio-blk-pci,drive=SystemDisk,scsi=off + -drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}" ${STATUS_QUO}) + else + # shellcheck disable=SC2054,SC2206 + args+=(-device ide-hd,bus=ahci.2,drive=SystemDisk + -drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}" ${STATUS_QUO}) + fi if [ -n "${fixed_iso}" ]; then # shellcheck disable=SC2054 @@ -601,6 +607,7 @@ iso="" port_forwards=() ram="" usb_devices=() +virtio_blk="on" DELETE=0 FULLSCREEN="" diff --git a/quickget b/quickget index a901f79..409c286 100755 --- a/quickget +++ b/quickget @@ -147,6 +147,13 @@ EOF if [ -n "${ISO_FILE}" ]; then echo "fixed_iso=\"${VM_PATH}/${ISO_FILE}\"" >> "${OS}-${RELEASE}.conf" fi + + # VirtIO Block Media doesn't work in High Sierra or Mojave so use SATA + case ${RELEASE} in + high-sierra|mojave) + echo "virtio_blk=\"off\"" >> "${OS}-${RELEASE}.conf" + ;; + esac fi }