Ubuntu

No sound from virtual machines

Reported by David Ayers on 2010-09-11
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Wishlist
Unassigned

Bug Description

Binary package hint: virt-manager

This is i386 host (pre-installed with feisty, subsequently upgraded through Lucid).
I'm using KVM with libvirt/virt-manager.

I've got a multitude of VM's but I guess the easiest to test is a fresh Lucid installation updated to current packages.

I've tested both the ac97 and es1370 virtual sound card. But no sound from the guest is being played by the host. The host can play sound from rhythmbox.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: virt-manager 0.8.2-2ubuntu8
ProcVersionSignature: Ubuntu 2.6.32-24.42-generic-pae 2.6.32.15+drm33.5
Uname: Linux 2.6.32-24-generic-pae i686
NonfreeKernelModules: nvidia
Architecture: i386
Date: Sat Sep 11 13:45:11 2010
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, user)
 LANG=de_AT.utf8
 SHELL=/bin/bash
SourcePackage: virt-manager

David Ayers (ayers) wrote :
Serge Hallyn (serge-hallyn) wrote :

Thanks for reporting this bug and helping to make Ubuntu better. I've definately
had plenty of VMs (usually when I needed quiet :) be able to play music, so I just
want to check whether there is anything peculiar to i386 or some other aspect of
your setup. So could you use 'testdrive' to fire up a lucid guest, and see whether
that, by default, with no tweaking, is able to play sound?

You should be able to just type 'testdrive-gtk', click the top box, and click the
'Launch' button at the bottom.

Changed in virt-manager (Ubuntu):
status: New → Incomplete
importance: Undecided → Low
David Ayers (ayers) wrote :

Using "testdrive" (note: testdrive-gtk does not exist for Lucid) the sound of the virtual machine was passed through to the host and working fine (well I'm not sure whether the volume control from within the VM should work as it didn't have any effect, but the volume control of the host worked fine)

I used ps -eaf to capture the command line of the VM when run via virt-manager, if that helps:
/usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 512 -smp 1 -name Maverick -uuid ce83abff-c8d7-233d-fb05-c1324d8ddf22 -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/Maverick.monitor,server,nowait -monitor chardev:monitor -boot c -drive file=/var/lib/libvirt/images/Maverick.img,if=virtio,index=0,boot=on,format=raw -drive file=/mnt/shared/ISO-Images/Ubuntu/ubuntu-10.10-beta-desktop-i386.iso,if=ide,media=cdrom,index=2,format=raw -net nic,macaddr=52:54:00:32:dc:5a,vlan=0,model=virtio,name=virtio.0 -net tap,fd=34,vlan=0,name=tap.0 -chardev pty,id=serial0 -serial chardev:serial0 -parallel none -usb -vnc 127.0.0.1:0 -vga cirrus -soundhw ac97

Changed in virt-manager (Ubuntu):
status: Incomplete → New

I can confirm this bug. If I run virtual machine directly by kvm (like "kvm -soundhw ac97 virtual_machine"), sound is ok. But if I use Virtual Machine Manager (virt-manager) with VNC server (like Virtual Display), no sound is played in the host.
I think, that it is probably the same bug like here: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/591489
and here: https://bugzilla.redhat.com/show_bug.cgi?id=595880

Changed in virt-manager (Ubuntu):
status: New → Confirmed
Serge Hallyn (serge-hallyn) wrote :

Richard,

if you use virt-manager with SDL, do you get sound?

Lack of sound support in vnc is a known missing feature. Thanks for the link to the bugzilla tracking its development.

Changed in virt-manager (Ubuntu):
importance: Low → Wishlist
status: Confirmed → Triaged
status: Triaged → Incomplete
status: Incomplete → Triaged
David Ayers (ayers) wrote :

Hello Serge,

I can confirm that adding a SDL graphics device in the VM configuration and removing the vnc device I was able to hear the sound.

So if virt-manager disables sound in its VNC device due to security issues and SDL only works locally, then there is currently no support for remote sound. It seems that upstream virt-manager has added support for spice: http://virt-manager.et.redhat.com/download.html but since I have not seen any spice packages in either ubuntu or debian, I fear it will take the order of a few years before those features will hit an LTS release, which is rather unfortunate.

BTW: closing the SDL window will turn the VM off hard. Is that expected behavior or should that be reported as a bug?

Quoting David Ayers (<email address hidden>):
> Hello Serge,
>
> I can confirm that adding a SDL graphics device in the VM configuration
> and removing the vnc device I was able to hear the sound.

Thanks.

> So if virt-manager disables sound in its VNC device due to security
> issues and SDL only works locally, then there is currently no support
> for remote sound. It seems that upstream virt-manager has added support
> for spice: http://virt-manager.et.redhat.com/download.html but since I
> have not seen any spice packages in either ubuntu or debian, I fear it
> will take the order of a few years before those features will hit an LTS
> release, which is rather unfortunate.

Yup, spice is very new but very actively developed upstream, so I expect
it to be in the next (12.04) LTS.

Unfortunately those patches are too new to be in any qemu-kvm upstream release,
so they are unlikely to be in 11.04 (which is not an LTS). As soon as upstream
pushes its next release, I will merge that, including spice support.

> BTW: closing the SDL window will turn the VM off hard. Is that expected
> behavior or should that be reported as a bug?

Yes, that is expected. You can use the -no-quit option to disable
closing the SDL window, but closing and re-opening it is not supported.

Marc Deslauriers (mdeslaur) wrote :

This is actually a libvirt issue.

affects: virt-manager (Ubuntu) → libvirt (Ubuntu)
Serge Hallyn (serge-hallyn) wrote :

spice is now in raring's qemu in main. If there are bugs please report them there.

Changed in libvirt (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.