Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have VM running on qemu-kvm. I am managing it with libvirt and command line tool virsh.

I want to record the audio output of the VM. Here is what I am trying -

virsh qemu-monitor-command -hmp VM_NAME wavcapture VM.wav

This is the output I am getting :

Failed to open wave file `vm.wav'
Reason: Permission denied
Failed to add wave capture

I have tried to create a dummy vm.wav with 777 permissions. But I still get the same error.

share|improve this question
up vote 0 down vote accepted

Ok. I guess I'll need to answer my own question. So as it turns out, libvirt uses apparmor for security of VMs. So the VM doesn't have r/w access to many locations. To use wavcapture, we need to provide access to the VM through apparmor rules. Straightforward way of doing this is to edit /etc/apparmor.d/abstractions/libvirt-qemu and add your rule. Then stop and start VM, and reload apparmor.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .