码迷,mamicode.com
首页 > 系统相关 > 详细

kvm与selinux

时间:2016-09-12 07:19:51      阅读:213      评论:0      收藏:0      [点我收藏+]

标签:

 

 Desktop virsh start 16lnmp
error: Failed to start domain 16lnmp
error: unsupported configuration: Unable to find security driver for label selinux
查看看selinux是关闭的:
?  Desktop grep -i ^selinux /etc/sysconfig/selinux
SELINUX=disabled
SELINUXTYPE=targeted 

查看libvirtd的启动日志:

?  Desktop tailf /var/log/libvirt/libvirtd.log

2016-09-11 22:38:33.812+0000: 3579: error : virSecurityManagerGenLabel:376 : unsupported configuration: Unable to find security driver for label selinux
2016-09-11 22:38:33.812+0000: 3579: error : qemuRemoveCgroup:824 : internal error Unable to find cgroup for 16lnmp
2016-09-11 22:38:33.812+0000: 3579: warning : qemuProcessStop:4617 : Failed to remove cgroup for 16lnmp
2016-09-11 22:38:33.813+0000: 3579: warning : qemuDomainObjStart:6252 : Unable to restore from managed state /var/lib/libvirt/qemu/save/16lnmp.save. Maybe the file is corrupted?

造成这个错误的原因是:

由于机器开机状态时,将SElinux的状态信息save在虚拟机中,导致SElinux关闭之后,虚拟找不到对应的label,从而导致vm启动失败。

如果配置配置文件中有selinux相关的配置,将其删除,如果没有,则可能已经保存在vm状态中,将原有的状态删除即可(对应路径/var/lib/libvirt/qemu/save),如下:

 ~ ls /var/lib/libvirt/qemu/save 
13svn.save  14git.save  15samba.save  16lnmp.save  26svn.save  centos7.save
?  ~ rm /var/lib/libvirt/qemu/save/16lnmp.save 
?  ~ virsh start 16lnmp
Domain 16lnmp started
#启动成功!!!

 

kvm与selinux

标签:

原文地址:http://www.cnblogs.com/bass6/p/5863443.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!