How do you set up audio for VM (KVM)?

I have my VM with pcie passthrough working nicely. But there’s one last piece missing - audio. Can’t get it to work. So far I’ve added “ich9” device in VM Manager. It shows up in Windows guest system, but no audio gets to host speakers. I’ve tried adding the “nographics_allow_host_audio=1” line to qemu.conf but that didn’t help either. Any suggestions how can I make it work?
my xml file

I don’t ordinarily use audio in my Guests, but still…

Is there some reason why you are doing hardware pass-through and not simply using a shared sound device?
My general rule of thumb is to try/test virtualized devices before doing a hardware passthrough, in part because any kind of hardware pass-through makes that device available only to that one machine and no other Guest or HostOS can use that device.


oh, sorry I haven’t been clear enough @tsu2 - the passthrough is for video card, not audio. I’ve just thought I’d mention that to gave a better picture of my setup.

So I’ve tried the “ich9” audio device in Virtual Machine Manager - I see it in the Windows guest, but I hear no audio coming.

Audio in KVM guests has always been a bit problematic.

You’ll find a number of solutions for specific setups (primarily Windows guests) if you do an Internet search with keywards like

qemu-kvm audio (The qemu is to try to filter out the keyboard-video-monitor results)
libvirt-kvm audio

Usual solutions have been along the same lines what you’ve tried… changing the audio device driver, sometimes manual edits to the configuration file. Since the audio device in the Guest is virtualized, it doesn’t have to match the real hardware as seen by the HostOS.

Since I’ve personally never had a need to use audio in KVM guests, my personal experience is nil on this although I’ve been aware it doesn’t always work easily.