Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.