由于 Apparmor,无法启动带有 SDL 显示的 QEMU VM:无法加载 AppArmor 配置文件“libvirt-32963ecb-fd2f-454c-93a6-c818af618ba4”

由于 Apparmor,无法启动带有 SDL 显示的 QEMU VM:无法加载 AppArmor 配置文件“libvirt-32963ecb-fd2f-454c-93a6-c818af618ba4”

我正在尝试使用 SDL 作为显示器而不是 spice 服务器在 virt-manager 中运行我的虚拟机。

虚拟机使用 spice 完美启动,但当我将其显示切换到 SDL 时,出现以下错误:

Error starting domain: internal error: cannot load AppArmor profile 'libvirt-32963ecb-fd2f-454c-93a6-c818af618ba4'`
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 101, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 57, in newfn
    ret = fn(self, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/domain.py", line 1329, in startup
    self._backend.create()
  File "/usr/lib/python3/dist-packages/libvirt.py", line 1353, in create
    raise libvirtError('virDomainCreate() failed')
libvirt.libvirtError: internal error: cannot load AppArmor profile 'libvirt-32963ecb-fd2f-454c-93a6-c818af618ba4'

包含“libvirt-32963ecb-fd2f-454c-93a6-c818af618ba4”的目录如下所示:

/etc/apparmor.d/libvirt$ ls -l

-rw-r--r-- 1 root root 293 Dec 26 00:21 libvirt-04e1e00e-eb6c-4b5a-b04d-87769a1a5d2d
-rw-r--r-- 1 root root 293 Jan  1 17:41 libvirt-072dbf37-2bb3-4ddc-b87b-f10d3fd3049e
-rw-r--r-- 1 root root 293 Jan  1 17:37 libvirt-2b6671ef-6184-4b22-88bc-ca532d45d170
-rw-r--r-- 1 root root 293 Jan  3 22:03 libvirt-32963ecb-fd2f-454c-93a6-c818af618ba4
-rw-r--r-- 1 root root 293 Jan  1 19:35 libvirt-6c092a74-1ef9-4c97-8f6c-be22eda71193
-rw-r--r-- 1 root root 293 Dec 26 00:20 libvirt-915f59ee-3a52-4eb1-a43e-35be01a41b16
-rw-r--r-- 1 root root 581 Dec 26 00:20 libvirt-915f59ee-3a52-4eb1-a43e-35be01a41b16.files
-rw-r--r-- 1 root root 293 Jan  1 19:50 libvirt-c871c97c-92ef-4c23-b75a-8fab2e8678e3
-rw-r--r-- 1 root root 342 Jan 15  2021 TEMPLATE.lxc
-rw-r--r-- 1 root root 192 Jan 15  2021 TEMPLATE.qemu

和'libvirt-32963ecb-fd2f-454c-93a6-c818af618ba4':

#
# This profile is for the domain whose UUID matches this file.
#

#include <tunables/global>

profile libvirt-32963ecb-fd2f-454c-93a6-c818af618ba4 flags=(attach_disconnected) {
  #include <abstractions/libvirt-qemu>
  #include <libvirt/libvirt-32963ecb-fd2f-454c-93a6-c818af618ba4.files>

}

我注意到该目录不包含文件所建议的“ibvirt-32963ecb-fd2f-454c-93a6-c818af618ba4.files”,但我不确定如何生成它。

我尝试重新安装 QEMU/KVM/libvirt 堆栈和 Apparmor,但没有成功。

由于我有点陷入了死胡同,任何指点都会有帮助。

谢谢 :)

相关内容