I wanted to run libvirt using a customized version of qemu. However, after I installed my version of qemu and rebooted I get the following message in dmesg
type=1400 audit(1338385059.381:51): apparmor="DENIED" operation="exec" parent=1700 profile="/usr/sbin/libvirtd" name="/usr/local/bin/qemu-system-x86_64" pid=1746 comm="libvirtd" requested_mask="x" denied_mask="x" fsuid=0 ouid=0
I tried editing the /etc/apparmor.d/abstractions/libvirt-qemu and added the following line and rebooted
/usr/local/bin/qemu-system-x86_64 rmix,
However the issue is still present. I am really new to apparmor, in fact hadn't read much on it till I found this error. Any help would be greatly appreciated.
Your log message indicates that the problem was in the
/usr/sbin/libvirtdprofile; see theprofile="/usr/sbin/libvirtd"portion of the message. This profile is stored in/etc/apparmor.d/usr.sbin.libvirtd; this profile does not include the/etc/apparmor.d/abstractions/libvirt-qemuabstraction -- this is instead loaded via the profiles in/etc/apparmor.d/libvirt/. See the last lines in thelibvirtdprofile:Probably the easiest answer would be to add the following line to your
local/usr.sbin.libvirtdfile:(Though perhaps it would require
PUxinstead; the main/usr/sbin/libvirtdprofile currently has/usr/bin/* PUx,, which is probably how the/usr/bin/qemu-system-x86_64gets executed currently.)Another approach is to run
aa-logprof, and allow the tools to prompt you. You may not build the prettiest profiles using the tools, but it should be fairly straightforward and have the same security properties as hand-authoring your profiles.I hope this helps.