kvm环境下可以使用shutdown命令让虚拟机关机,但不生效。
virsh shutdown centos
原因为 由于关机通过acpi电源管理接口来实现的,虚拟机内部需要安装有acpid服务并运行
Windowns的虚拟机一般情况是默认已安装且运行的
linux虚拟机,如centos,在安装了最简版后并没有安装这个服务,需要我们自己来安装好;
进入不能关机的虚拟机中:
[root@localhost ~]# yum -y install acpid ;安装acpid服务
[root@localhost ~]# service acpid restart ;启动服务
[root@localhost ~]# chkconfig acpid on ;加入开机启动
通过以上步骤后就可以让虚拟机响应shutdown 和reboot命令了
评论