虚拟机报错Unable to read from monitor: Connection reset by peer

解决方案就是把restore移除先,再启动虚拟机
# virsh start Monitor
错误:开始域 Monitor 失败
错误:Unable to read from monitor: Connection reset by peer
# virsh  managedsave-remove Monitor
Removed managedsave image for domain Monitor
# virsh start Monitor
域 Monitor 已开始

1,问题现象:启动kvm实例报错,比如:

  1. [root@master ~]# vr start mysqlmaster
  2. error: Failed to start domain mysqlmaster
  3. error: unsupported configuration: Unable to find security driver for label selinux

看报错和日志基本确定是selinux的原因,但系统关闭selinux并重启以后依旧报错。查资料知晓原因:
由于机器开机状态时,将SElinux的状态信息save在虚拟机中,导致SElinux关闭之后,虚拟找不到对应的label,从而导致vm启动失败。

 

KVM实例由于selinux设置导致报错error: unsupported configuration: Unable to find security driver for label selinux解决办法

2,解决办法:
virsh edit domain_name查看虚拟机的配置文件中,是否有selinux标签的相关设置,如果有,则将其删除,再启动vm。
vr edit 对应实例,搜索selinux,将该行标签删除,重启成功。

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

  1. virsh managedsaveremove 对应实例

Leave a Reply

Your email address will not be published. Required fields are marked *