Qemu macOS Sequoia 15.2 vm runs well, VMM kvm fails to start with sound error

System is an HP Laptop 17t-cn300 with 13th Gen Intel® Core™ i7-1355U × 12 threads, 64GB RAM, 2TB SSD.

Ubuntu 24.10 with Linux 6.11.0-13 generic kernel.
VMM 4.1.0
qemu-system-x86 1:9.0.2+ds-4ubuntu5.1
libvirt-clients 10.6.0-1ubuntu3.1
python3 3.12.6-0ubuntu1
python3-pip 24.2+dfsg-1ubuntu0.1

also:
installed VoodooHDA-kext v301 in macOS vm and disabled SIP per instructions in https://oneclick-macos-simple-kvm.notaperson535.is-a.dev/docs/guide-audio

As topic states qemu cli runs well as:

qemu-system-x86_64 -enable-kvm -m 8G -machine q35,accel=kvm -smp cores=2,threads=2,sockets=1 -cpu Haswell-v4,vendor=GenuineIntel,kvm=on,+sse3,+sse4.2,+aes,+xsave,+avx,+xsaveopt,+xsavec,+xgetbv1,+avx2,+bmi2,+smep,+bmi1,+fma,+movbe,+invtsc,+avx2 -device isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc -smbios type=2 -device intel-hda -device hda-output -drive if=pflash,format=raw,readonly=on,file=/vm/macOS2/firmware/OVMF_CODE.fd -drive if=pflash,format=raw,file=/vm/macOS2/firmware/OVMF_VARS.fd -vga qxl -usb -device qemu-xhci -device usb-kbd -device usb-tablet -netdev user,id=net0 -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27 -monitor telnet:127.0.0.1:5801,server,nowait -device ich9-ahci,id=sata -drive id=OpenCore,if=none,format=qcow2,file=/vm/macOS2/OpenCore.qcow2 -device ide-hd,bus=sata.2,drive=OpenCore -drive id=SystemDisk,if=none,file=/vm/macOS2/macOS.qcow2 -device ide-hd,bus=sata.4,drive=SystemDisk

The VMM kvm fails with error:

Error starting domain: internal error: QEMU unexpectedly closed the monitor (vm=‘macOS-Simple-KVM’): 2025-01-08T18:17:51.575192Z qemu-system-x86_64: -device hda-output: no default audio driver available
Perhaps you wanted to use -audio or set audiodev=audio1?

Traceback (most recent call last):
File “/usr/share/virt-manager/virtManager/asyncjob.py”, line 72, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File “/usr/share/virt-manager/virtManager/asyncjob.py”, line 108, in tmpcb
callback(*args, **kwargs)
File “/usr/share/virt-manager/virtManager/object/libvirtobject.py”, line 57, in newfn
ret = fn(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/share/virt-manager/virtManager/object/domain.py”, line 1402, in startup
self._backend.create()
File “/usr/lib/python3/dist-packages/libvirt.py”, line 1379, in create
raise libvirtError(‘virDomainCreate() failed’)
libvirt.libvirtError: internal error: QEMU unexpectedly closed the monitor (vm=‘macOS-Simple-KVM’): 2025-01-08T18:17:51.575192Z qemu-system-x86_64: -device hda-output: no default audio driver available
Perhaps you wanted to use -audio or set audiodev=audio1?

Here is the vmm xml:

<blockquote>
<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">
  <name>macOS-</name>
  <uuid>d06d502a-904a-4b34-847d-debf1a3d76c7</uuid>
  <memory unit="KiB">8388608</memory>
  <currentMemory unit="KiB">8388608</currentMemory>
  <vcpu placement="static">4</vcpu>
  <os>
    <type arch="x86_64" machine="pc-q35-9.0">hvm</type>
    <loader readonly="yes" type="pflash">/vm/macOS2/firmware/OVMF_CODE.fd</loader>
    <nvram>/vm/macOS2/firmware/OVMF_VARS.fd</nvram>
    <boot dev="hd"/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <vmport state="off"/>
  </features>
  <cpu mode="custom" match="exact" check="none">
    <model fallback="forbid">Nehalem-IBRS</model>
    <topology sockets="1" dies="1" clusters="1" cores="4" threads="1"/>
  </cpu>
  <clock offset="utc">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled="no"/>
    <suspend-to-disk enabled="no"/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type="file" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source file="/vm/macOS2/OpenCore.qcow2"/>
      <target dev="sda" bus="sata"/>
      <address type="drive" controller="0" bus="0" target="0" unit="0"/>
    </disk>
    <disk type="file" device="disk">
      <driver name="qemu" type="raw"/>
      <source file="/vm/macOS2/BaseSystem.img"/>
      <target dev="sdb" bus="sata"/>
      <address type="drive" controller="0" bus="0" target="0" unit="1"/>
    </disk>
    <controller type="usb" index="0" model="qemu-xhci">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1d" function="0x0"/>
    </controller>
    <controller type="sata" index="0">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1f" function="0x2"/>
    </controller>
    <controller type="pci" index="0" model="pcie-root"/>
    <controller type="pci" index="1" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="1" port="0x18"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0" multifunction="on"/>
    </controller>
    <controller type="pci" index="2" model="pcie-to-pci-bridge">
      <model name="pcie-pci-bridge"/>
      <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
    </controller>
    <controller type="pci" index="3" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="3" port="0x19"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x1"/>
    </controller>
    <interface type="network">
      <mac address="52:54:00:92:d4:7b"/>
      <source network="default"/>
      <model type="vmxnet3"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0"/>
    </interface>
    <serial type="pty">
      <target type="isa-serial" port="0">
        <model name="isa-serial"/>
      </target>
    </serial>
    <console type="pty">
      <target type="serial" port="0"/>
    </console>
    <input type="mouse" bus="usb">
      <address type="usb" bus="0" port="1"/>
    </input>
    <input type="keyboard" bus="usb">
      <address type="usb" bus="0" port="2"/>
    </input>
    <input type="mouse" bus="ps2"/>
    <input type="keyboard" bus="ps2"/>
    <graphics type="spice" autoport="yes">
      <listen type="address"/>
      <image compression="off"/>
    </graphics>
    <sound model="ich9">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1b" function="0x0"/>
    </sound>
    <audio id="1" type="spice"/>
    <video>
      <model type="qxl" ram="65536" vram="65536" vgamem="16384" heads="1" primary="yes"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
    </video>
    <redirdev bus="usb" type="spicevmc">
      <address type="usb" bus="0" port="3"/>
    </redirdev>
    <redirdev bus="usb" type="spicevmc">
      <address type="usb" bus="0" port="4"/>
    </redirdev>
    <watchdog model="itco" action="reset"/>
    <memballoon model="none"/>
  </devices>
  <qemu:commandline>
    <qemu:arg value="-cpu"/>
    <qemu:arg value="host,vendor=GenuineIntel,kvm=on,+sse3,+sse4.2,+aes,+xsave,+avx,+xsaveopt,+xsavec,+xgetbv1,+avx2,+bmi2,+smep,+bmi1,+fma,+movbe,+invtsc,+avx2"/>
    <qemu:arg value="-device"/>
    <qemu:arg value="isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"/>
    <qemu:arg value="-smbios"/>
    <qemu:arg value="type=2"/>
    <qemu:arg value="-device"/>
    <qemu:arg value="intel-hda"/>
    <qemu:arg value="-device"/>
    <qemu:arg value="hda-output"/>
  </qemu:commandline>
</domain>
</blockquote>

So I have a working vm but can’t get a working Virtual Machine Manager xml file that works and I can’t seem to find a way to debug the problem. Duplicating the qemu-x86_64 cli in the VMM results in many errors. The config I posted above I have reduced to just the sound error.

I would highly recommend getting support from the people who would know more about this as it’s not likely an Ubuntu problem, but more like one of those quirks with macOS with qemu. Luckily, there’s a place for that:

They even have links to a discord chat server and a very concise install guide, including a guide for Passthrough Audio.

Personally I use Quickemu to run macOS on Ubuntu.

I appreciate you may not want to switch too, but one thing you might like, is that Quickemu can generate a launcher, which has all the well-tested options enabled.

It could give you some clues on how to fix the way you’re launching with your current tools.

Here’s the launcher quickemu generated for me today.

#!/usr/bin/env bash
/usr/bin/qemu-system-x86_64 \
    -name macos-sonoma,process=macos-sonoma \
    -machine q35,hpet=off,smm=off,vmport=off,accel=kvm \
    -global kvm-pit.lost_tick_policy=discard \
    -global ICH9-LPC.disable_s3=1 \
    -device isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal\(c\)AppleComputerInc \
    -global nec-usb-xhci.msi=off \
    -cpu Haswell-v2,vendor=GenuineIntel,-pdpe1gb,+avx,+sse,+sse2,+ssse3,vmware-cpuid-freq=on,+avx2,+sse4.2,+abm,+adx,+aes,+apic,+arat,+bmi1,+bmi2,+clflush,+cmov,+cx8,+cx16,+de,+erms,+f16c,+fma,+fsgsbase,+fxsr,+invpcid,+lahf-lm,+lm,+mca,+mce,+mmx,+movbe,+msr,+mtrr,+nx,+pae,+pat,-pcid,+pge,+pse,+popcnt,+pse36,+rdrand,+rdtscp,+sep,+smep,+syscall,+tsc,+vaes,+vpclmulqdq,+x2apic,+xgetbv1,+xsave,+xsaveopt \
    -smp cores=4,threads=2,sockets=1 \
    -m 8G \
    -device virtio-balloon \
    -rtc base=localtime,clock=host,driftfix=slew \
    -pidfile macos-sonoma/macos-sonoma.pid \
    -vga none \
    -device VGA,xres=1280,yres=800,vgamem_mb=256 \
    -display sdl,gl=on \
    -device virtio-rng-pci,rng=rng0 \
    -object rng-random,id=rng0,filename=/dev/urandom \
    -device nec-usb-xhci,id=spicepass \
    -chardev spicevmc,id=usbredirchardev1,name=usbredir \
    -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1 \
    -chardev spicevmc,id=usbredirchardev2,name=usbredir \
    -device usb-redir,chardev=usbredirchardev2,id=usbredirdev2 \
    -chardev spicevmc,id=usbredirchardev3,name=usbredir \
    -device usb-redir,chardev=usbredirchardev3,id=usbredirdev3 \
    -device pci-ohci,id=smartpass \
    -device usb-ccid \
    -chardev spicevmc,id=ccid,name=smartcard \
    -device ccid-card-passthru,chardev=ccid \
    -device qemu-xhci,id=input \
    -device usb-kbd,bus=input.0 \
    -k en-us \
    -device usb-tablet,bus=input.0 \
    -audiodev pa,id=audio0 \
    -device intel-hda \
    -device hda-micro,audiodev=audio0 \
    -device virtio-net,netdev=nic \
    -netdev user,hostname=macos-sonoma,hostfwd=tcp::22220-:22,smb=/home/alan/,id=nic \
    -global driver=cfi.pflash01,property=secure,value=on \
    -drive if=pflash,format=raw,unit=0,file=macos-sonoma/OVMF_CODE.fd,readonly=on \
    -drive if=pflash,format=raw,unit=1,file=macos-sonoma/OVMF_VARS-1920x1080.fd \
    -device ahci,id=ahci \
    -device ide-hd,bus=ahci.0,drive=BootLoader,bootindex=0 \
    -drive id=BootLoader,if=none,format=qcow2,file=macos-sonoma/OpenCore.qcow2 \
    -device ide-hd,bus=ahci.1,drive=RecoveryImage \
    -drive id=RecoveryImage,if=none,format=raw,file=macos-sonoma/RecoveryImage.img \
    -device virtio-blk-pci,drive=SystemDisk \
    -drive id=SystemDisk,if=none,format=qcow2,file=macos-sonoma/disk.qcow2 \
    -fsdev local,id=fsdev0,path=/home/alan/,security_model=mapped-xattr \
    -device virtio-9p-pci,fsdev=fsdev0,mount_tag=Public-alan \
    -monitor unix:macos-sonoma/macos-sonoma-monitor.socket,server,nowait \
    -serial unix:macos-sonoma/macos-sonoma-serial.socket,server,nowait 2>/dev/null

This is not a QEMU quirk but rather a VMM issue. VMM consists primarily of scripts. The qemu cli works well as the topic states and as the screenshot proves. Moreover, if you go back and read the post carefully , I posted the link to the github repository that you cited. The vmm xml generated by that basic.sh script in git repository does NOT work. In fact it generates an even worse config that crashes with multiple errors. The VMM can’t even support the correct processor by default so a pass-through must manually be specified after the fact. qemu works well and VMM cannot. Fairly obvious where the issue lies. It would be helpful if somebody understood how to debug this issue. The i7-1355U is a SOC which has become quite common on laptops and anybody attempting to deploy a MacOS VM on one will encounter this issue. I note that this problem occurs on any release subsequent to MacOS release Ventura has this problem while prior versions do not. The i7-1355U works well with qemu if the processor is set as a Haswell-v4 but VMM wasn’t scripted to account for it. Similarly VMM scripts do not recognize machine ids of pc-q35-oracular or ubuntu-q35. Pretty shabby of the VMM development team since its in the Ubuntu distro. If I begin to dissect and alter the VMM package code I shall be doomed to maintaining it for myself forever. I endured that nightmare on Mac OS X at a Fortune 500 company as a result of Soxley requirements. QEMU developers considered Ubuntu and coded for it; VMM project did not do so or the version on Oracular is dated.

Perhaps you could help me on the discourse post however. I can’t seem to find a way to encapsulate the xml code I intended to post. None of the tags seem to work and encapsulating it within quotes or blockquotes didn’t work either. I must be missing something.

The pointer is appreciated, however, I have a working qemu cli config so quickemu will only provide something similar to what I already generated and it works well. I plan on trying the quickemu to see what it generates. I don’t need to VMM gui. It’s just that weird quirks like this bug me in idle moments. Thanks again.

1 Like

You can use 3 backticks ``` before and after the code:

#!/usr/bin/env bash
/usr/bin/qemu-system-x86_64 \
    -name macos-sonoma,process=macos-sonoma \
    -machine q35,hpet=off,smm=off,vmport=off,accel=kvm \

And welcome to Ubuntu Discourse :slight_smile:

1 Like

Thanks rubi1200. Time for me to RTFM the shortcode documentation. :grin:

1 Like