尝试启动我们的 kvm 虚拟机并在重新启动物理主机后出现此错误。
Error starting domain: unsupported configuration: Unable to find security driver for model selinux
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 88, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 124, in tmpcb
callback(*args, **kwargs)
File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 83, in newfn
ret = fn(self, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/domain.py", line 1479, in startup
self._backend.create()
File "/usr/lib/python2.7/site-packages/libvirt.py", line 1062, in create
if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: unsupported configuration: Unable to find security driver for model selinux
检查主机显示 Selinux 已被禁用。
$ getenforce
Disabled
答案1
备份并运行虚拟机
我运行了以下命令来编辑域 xml 配置文件。
$ virsh edit some-virtual-machine / domain
删除虚拟机域定义 xml 启动附近的以下行。
<seclabel type='dynamic' model='selinux' relabel='yes'/>
这会使虚拟机启动并运行。
您还可以在尝试启动虚拟机之前编辑 libvirt 配置目录中的配置。/etc/libvirt/qemu/