You are not logged in.

#1 2014-01-23 02:43:37

taro
Member
Registered: 2013-11-08
Posts: 17

No sound from VM (Windows 7) on qemu with virt-manager

I have installed Windows 7 (64bit) on qemu with virt-manager.
It seems that audio works fine inside the guest os, but I can hear no sound.

[Guest]
Guest os: Windows 7 (64 bit)
Sound driver: ich6
Console: Spice (VNC doesn't work.)

[Host]
linux 3.12.8-1 (base)
qemu 1.7.0-1
virt-manager 0.10.0-4
libvirt 1.2.1-1

According to
https://bbs.archlinux.org/viewtopic.php?id=157604
I did as follow before launch the VM, but it doesn't solve the problem.
export QEMU_AUDIO_DRV=alsa

What shoud I check and do?


For additional information,

% ps aux | grep kvm                                                     [~]
root       252  0.0  0.0      0     0 ?        S<   02:25   0:00 [kvm-irqfd-clea
n]
nobody   10199 63.0 27.0 1613768 1070088 ?     Sl   11:31   0:34 /usr/sbin/qemu-system-x86_64 -name win7qemu002 -S -machine pc-i440fx-1.7,accel=kvm,usb=off -m 1024 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 00b5056b-9055-aa4f-d7a6-aef72cc8edd4 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/win7qemu002.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime -no-shutdown -boot menu=off,strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 -drive file=/mnt/win/win7qemu002,if=none,id=drive-ide0-0-0,format=raw -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -drive if=none,id=drive-ide0-1-0,readonly=on,format=raw -device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=22,id=hostnet0 -device e1000,netdev=hostnet0,id=net0,mac=08:00:27:8f:ff:84,bus=pci.0,addr=0x7,bootindex=1 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -device usb-tablet,id=input0 -spice port=5900,addr=127.0.0.1,disable-ticketing,seamless-migration=on -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 -device intel-hda,id=sound0,bus=pci.0,addr=0x3 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
root     10201  0.0  0.0      0     0 ?        S    11:31   0:00 [kvm-pit/10199]
taro     10340  0.0  0.0  10668  1060 pts/2    S+   11:32   0:00 grep kvm

* If I put the same command above
% /usr/sbin/qemu-system-x86_64 -name win7qemu002...
It produces error.
char device redirected to /dev/pts/4 (label charserial0)
Could not access KVM kernel module: Permission denied
failed to initialize KVM: Permission denied

* According to the someone's discussion,
I added my user to kvm group
% sudo gpasswd -a taro kvm
or edited /etc/libvirt/qemu.conf, but they don't fix this errors.
% sudo vi /etc/libvirt/qemu.conf
- #user = "root"
+ user = "taro"

* Everytime I launch the virt-manager,
a dialog "Authentication" pops-up and asks
for my user password (not root password).

best regards.

Last edited by taro (2014-06-29 02:54:25)

Offline

#2 2014-02-15 12:33:20

taro
Member
Registered: 2013-11-08
Posts: 17

Re: No sound from VM (Windows 7) on qemu with virt-manager

Self reply.

Finally, I got to hear sound from windows 7 as guest OS.
I gave up to use virt-manager and launches OS image by command line
like follows.
% export QEMU_AUDIO_DRV=alsa
% qemu-system-x86_64 /mnt/win/win7qemu002 -cpu kvm64,+nx -enable-kvm -m 1536 -soundhw hda -usb

Then, sounds works good.
# However, the quality is bad because of heavy CPU load.
Virt-manager may make things complex..

Last edited by taro (2014-02-15 12:37:14)

Offline

#3 2014-02-15 14:14:22

korn36
Member
Registered: 2014-01-14
Posts: 111

Re: No sound from VM (Windows 7) on qemu with virt-manager

# However, the quality is bad because of heavy CPU load.
Change your samplerate on the windows 7 to the one you have set on your real pc. It's usually 48kHz (48000Hz) or 44.1kHz (44100Hz).

Offline

#4 2014-02-17 04:19:33

taro
Member
Registered: 2013-11-08
Posts: 17

Re: No sound from VM (Windows 7) on qemu with virt-manager

Thank you for your comment.
Do you mean the setting on windows 7 is
in Control panel -> sound
Then, I chose
Property of Speaker - High Definition Audio device
Then I can choose bit rate in detail tab.
Is this correct? (some terms may differ because of Japanese edition.)

I tried both 44100 and 48000 to play test sound
(and other choices), however, the quality is not improved.
If you have any other idea, please let me know.

By the way, launching with -soundhw hda
makes windows 7 slow especially when it plays sound,
and windows 7 runs fast without soundhw option.

Offline

#5 2014-04-12 20:26:35

kentrell.johnson
Member
Registered: 2014-04-12
Posts: 1

Re: No sound from VM (Windows 7) on qemu with virt-manager

I had the same or similar sound problem--heavy CPU load and slow, distorted playback.   I was using virt-manager with the ich6 sound device on Windows 7 64-bit.

The solution for me was to switch to Windows 7 32-bit, use the ac97 sound device, then download an optional update ac97 driver through Windows Update.  Windows 7 64-bit does not provide a driver for ac97.

Don't know if Windows 7 32-bit is an option for you, but maybe this will help someone.

Last edited by kentrell.johnson (2014-04-12 20:27:53)

Offline

#6 2014-06-28 23:35:51

weirddan455
Member
Registered: 2012-04-15
Posts: 209

Re: No sound from VM (Windows 7) on qemu with virt-manager

I'm having the same issue.  Not running Windows though... I have a minimal Ubuntu 14.04 as the guest (Arch as the host.)  Been trying everything I can think of but I can't get any sound in virt-manager.  Like you said, the sound seems to play OK in the guest, it's recognizing the card, volume is turned up but no sound.  It has to be an issue with my host configuration but I'm not sure what.  I can get sound to play in the same guest if I launch qemu directly and use ac97.  Something's gotta just be misconfigured with virt-manager/libvirt/Spice.  I thought a permissions issue at first since by default it runs as the "nobody" user but I even tried the foolish thing of setting /etc/libvirt/qemu.conf so qemu runs as root... still no go.  I'd really like to use virt-manager for the nice GUI, presistant settings, and extra features like Spice and the QXL driver that enables KMS on the guest.

Offline

#7 2014-06-29 02:57:00

taro
Member
Registered: 2013-11-08
Posts: 17

Re: No sound from VM (Windows 7) on qemu with virt-manager

Hi, I have just found a discussion on the upstream. Will this help for you?
https://bugzilla.redhat.com/show_bug.cgi?id=848927

I have tried by editing
vnc_allow_host_audio = 1 in /etc/libvirt/qemu.conf
with virt-manager running as user and root, but the problem isn't solved for me so far.
Please report here if you have any progress!

Offline

#8 2014-06-29 07:45:12

weirddan455
Member
Registered: 2012-04-15
Posts: 209

Re: No sound from VM (Windows 7) on qemu with virt-manager

taro wrote:

Hi, I have just found a discussion on the upstream. Will this help for you?
https://bugzilla.redhat.com/show_bug.cgi?id=848927

I have tried by editing
vnc_allow_host_audio = 1 in /etc/libvirt/qemu.conf
with virt-manager running as user and root, but the problem isn't solved for me so far.
Please report here if you have any progress!

I'm not using VNC.  I'm using the Spice server.  I actually couldn't get VNC to work at all.  I may just be lacking some dependencies but it popped an error and wouldn't even start the VM.  I also don't see it as a permissions issue as stated in that bug report because I already tried running qemu as root.

Offline

Board footer

Powered by FluxBB