Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've got a VM. I want to make it used the sound card of the machine it is hosted on.

I added to my /etc/libvirt/myvm.xml: <sound model='ac97'/> and then did:

 virsh #define myvm.xml
 virsh #stat myvm

The sound device is showing up will alsamixer, but when I play audio nothing happens. The VM is running Debian sqeeze, as is the host machine. the sound is working on the host machine (I tested that separately)

Is this cos it is trying to play audio on the computer I'm accessing the VM from?

Here is the output when I try to play something (1.mp3)

>mplayer 1.mp3 
MPlayer 1.0rc3-4.4.4 (C) 2000-2009 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing 1.mp3.
Audio only file format detected.
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
AO: [pulse] Init failed: Connection refused
Failed to initialize audio driver 'pulse'
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
<<Progress Bar>>

EDIT: Am i going about this entirely the wrong way? Should I be using pulse audio to send the sound back to the host?ad

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.