Add NET_DEVICE and USB_HOST_PASSTHROUGH_CONTROLLER variables

macOS doesn't support USB3 in Qemu and needs a different network interface device from Linux and Windows.
This commit is contained in:
Martin Wimpress 2021-09-27 22:51:48 +01:00
parent 89e61c4e9e
commit 2609189dbb
No known key found for this signature in database
GPG key ID: 61DF940515E06DA3

View file

@ -146,8 +146,10 @@ function vm_boot() {
local GL="on" local GL="on"
local GUEST_TWEAKS="" local GUEST_TWEAKS=""
local HOST_CPU="" local HOST_CPU=""
local NET_DEVICE="virtio-net"
local OSK="" local OSK=""
local QEMU_VER="" local QEMU_VER=""
local USB_HOST_PASSTHROUGH_CONTROLLER="qemu-xhci"
local VIDEO="" local VIDEO=""
QEMU_VER=$(${QEMU} -version | head -n1 | cut -d' ' -f4 | cut -d'(' -f1) QEMU_VER=$(${QEMU} -version | head -n1 | cut -d' ' -f4 | cut -d'(' -f1)
echo "Starting ${VM}" echo "Starting ${VM}"
@ -201,6 +203,8 @@ function vm_boot() {
OSK=$(echo "bheuneqjbexolgurfrjbeqfthneqrqcyrnfrqbagfgrny(p)NccyrPbzchgreVap" | rot13) OSK=$(echo "bheuneqjbexolgurfrjbeqfthneqrqcyrnfrqbagfgrny(p)NccyrPbzchgreVap" | rot13)
GUEST_TWEAKS="-device isa-applesmc,osk=${OSK}" GUEST_TWEAKS="-device isa-applesmc,osk=${OSK}"
disk="64G" disk="64G"
NET_DEVICE="vmxnet3"
USB_HOST_PASSTHROUGH_CONTROLLER="usb-ehci"
;; ;;
windows) windows)
CPU="-cpu host,kvm=on,hv_time" CPU="-cpu host,kvm=on,hv_time"
@ -209,6 +213,7 @@ function vm_boot() {
;; ;;
*) *)
CPU="-cpu host,kvm=on" CPU="-cpu host,kvm=on"
NET_DEVICE="rtl8139"
echo "WARNING! Unrecognised guest OS: ${guest_os}" echo "WARNING! Unrecognised guest OS: ${guest_os}"
;; ;;
esac esac