How do you get sound working on a Windows 7 guest OS in KVM on Ubuntu 11.10?

20,443

Solution 1

This is a known bug with KVM, and there are several bug reports and potential work arounds.

Some people have reported using alternate sound drivers, the es1370 in particular.

If that does not work , try editing /etc/libvirt/qemu.conf and changing vnc_allow_host_audio = 0 to

vnc_allow_host_audio = 1

Restart libvirtd or reboot.

For additional information , see these links.

https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/591489/comments/11

https://fedoraproject.org/wiki/How_to_debug_Virtualization_problems#Audio_output

Solution 2

Actually, if anything it's a bug with the /etc/apparmor.d/ profiles for libvirt.

Near as I can tell apparmor gleefully stomps Qemu/KVMs access to pulseaudio even if you try to do the right thing and set the respective profiles into complain mode with aa-complain (you need to sudo apt-get install apparmor-utils to even have that command but as it turns out it is a waste of time).

To make a long story short - as of March 2012 on Ubuntu 11.10 you have a choice between apparmor and KVM guest sound for Windows 7.

Also, in addition to the qemu.conf change above, you should also bypass any other perms issues by explicitly setting:

user = "yourlogin"
group = "yourlogin"

as well. Reboot. You'll be able to hear things.

Share:
20,443

Related videos on Youtube

Jim
Author by

Jim

I'm a Linux and Unix Systems Administrator that gets a kick out of solving problems and helping people. I work a lot with various types of scripting to hold stuff together.

Updated on September 18, 2022

Comments

  • Jim
    Jim over 1 year

    I have Ubuntu 11.10 installed on my work laptop. I have a Windows 7 (32 bit) guest OS installed using Virt-Manager.

    Everything works fine, EXCEPT sound.

    AC97 hardware is configured in the guest OS Virt-Manager profile AND Windows sees AC97 as the hardware in the guest OS when it is running. If you run audio tests in Windows, it acts like it is working.

    I just don't hear anything coming out of the speakers.

    Someone has to have been able to get Windows sound (in a guest OS under KVM with the qemu emulator running).

    Please share how you did it.

    • Jim
      Jim almost 9 years
      Setting up the SPICE packages to run with KVM from the ubuntu packages and then configuring sound and video to use the SPICE drivers appears to have solved this problem.