I hit this same issue, setting up a Windows guest. And I can't for the life of me find any of the web resources I looked up to find the solution. But, at least in my case, the issue was the ancient AC97 sound hardware that the VMs were configured with by default, which resulted in the guest needing some out-of-date sound driver that never worked.
As indicated in this answer, the sound device ich6
was properly detected by Windows (when all others weren't), and as I recall that was all it took to get sound working for me. I don't recall doing any of the crazy stuff in the 'Audio output' section of Fedora wiki's virtualization page.
if you run virsh list --all
in a terminal, you'll see a list of the configured virtual machines, and virsh edit <name>
will launch an editor to modify the configuration of the named guest. Unfortunately I no longer have the original text from before I modified it, but I edited the <sound...
definition in there to read:
<sound model='ich6'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<graphics type='spice'>
<listen type='none'/>
<image compression='off'/>
</graphics>
And as you can see I'm using Spice instead of VNC for display (since according to /etc/libvirt/qemu.conf
)...
# QEMU implements an extension for providing audio over a VNC connection,
# though if your VNC client does not support it, your only chance for getting
# sound output is through regular audio backends. By default, libvirt will
# disable all QEMU sound backends if using VNC, since they can cause
# permissions issues. Enabling this option will make libvirtd honor the
# QEMU_AUDIO_DRV environment variable when using VNC.
#
#vnc_allow_host_audio = 0
(I have not had to enable vnc_allow_host_audio
in my setup.)
With ich6
as the sound device emulation and <graphics type='spice'>
for display, I have working, problem-free sound on both Windows and Fedora guests.
ETA: Opening up virt-manager
and pulling up the hardware details for a guest, if I select the audio device there's a "Model:" dropdown that allows me to select among the various emulated sound devices. And I see that in addition to ich6
there's also the newer ich9
, which I'm tempted to try. But, if editing the XML directly seems daunting, that's another way to go.
