I am receiving an error while starting up a newly created virtual machine in ubuntu 17.10 using Virtual machine Manager. It worked fine once but I shut it down and now can't get it to start, I get - Error starting domain: internal error: cannot load AppArmor profile 'libvirt-
6 Answers
Ubuntu 22.04 and I still have the issue. Good news : no need to uninstall apparmor. Only two quick steps are needed:
- set security_driver = "none" in /etc/libvirt/qemu.conf
# vim /etc/libvirt/qemu.conf
security_driver = [ "selinux", "apparmor" ]
#security_driver = "selinux"
security_driver = "none"
- restart libvirtd service
# systemctl restart libvirtd
I had to uninstall apparmor competely followed by a reinstall of apparmor to make it work.
In my case the ISO image was on an mounted storage, so the solution was:
sudo nano /etc/apparmor.d/local/usr.lib.libvirt.virt-aa-helper
added the entries for iso:
/media/DATA/Downloads/Distros/** r,
/{media,mnt,opt,srv}/** r
That's it. The error is gone.
Reference: LibvirtApparmor - Ubuntu Wiki

- 17,696
I got the exact same error message on Ubuntu Server 18.04.1 x64 when moving kvm virtual machines from an older 14.04.5 Ubuntu Server install. Reinstalling apparmor
didn't do it for me.
It turned out that I was missing the package libvirt-daemon-system
. After installing this package, the virtual machines booted with no errors.

- 3,164

- 11
- 3
In my case (Ubuntu 22.04.2 LTS, virsh 8.0.0), I was simply out of disk space due to a couple large log files from some running containers in /var/lib/docker/overlay2. After cleaning this up, the VM running under Virtual Machine Manager (4.0.0) started with no errors.
Re-installing apparmor fixed it for me on Ubuntu 23.10
$ sudo apt remove --purge apparmor-utils apparmor-profiles apparmor-profiles-extra
$ sudo apt remove --purge apparmor
$ sudo rm -rf /var/cache/apparmor
$ sudo apt install apparmor apparmor-utils apparmor-profiles apparmor-profiles-extra
$ sudo apt remove --purge libvirt-daemon-system
$ sudo apt install libvirt-daemon-system
$ sudo systemctl restart libvirtd.service
$ sudo systemctl restart virtlogd.service
$ sudo systemctl restart virtlogd.socket

- 111
sudo apt-get update
followed bysudo apt-get dist-upgrade
? Did both complete without warnings or error messages? And please edit your question to include the full error. It seems incomplete. – DK Bose May 07 '18 at 03:47virsh dominfo
and then check for/etc/apparmor.d/libvirt/libvirt-<UUID>.files
if that looks sane. – Christian Ehrhardt May 07 '18 at 14:07