我安装了KVM,并在我的Debian7.1主机上使用了两个Debian7.1客户和一些Windows客户。当我使用命令'virsh关机‘或在virt管理器中按下关机按钮时,Debian来宾会进入go悬挂状态。
唯一能正确关闭的方法是对这些来宾进行ssh,并键入“立即关闭-h”命令。
在这两位debian来宾上,我都安装并运行了这些包:
ii acpi 1.6-1 amd64 displays information on ACPI devices
ii acpi-fakekey 0.140-5 amd64 tool to generate fake key events
ii acpi-support 0.140-5 all scripts for handling many ACPI events
ii acpi-support-base 0.140-5 all scripts for handling base ACPI events such as the power button
ii acpid 1:2.0.16-1+deb7u1 amd64 Advanced Configuration and Power Interface event daemon以下是我对我的debian客人所发生的事情:
:/etc/acpi/events$ cat powerbtn-acpi-support
event=button[ /]power
action=/etc/acpi/powerbtn-acpi-support.sh/etc/acpi/powerbtn-acpi-support.sh
#!/bin/sh
# This script initiates a shutdown when the power putton has been
# pressed. Loosely based on the sample that ships with the acpid package.
# If the acpid sample is present as a real config file (as it was in earlier
# versions of acpid), we skip this script. (Purging and reinstalling acpid
# resolves this situation, or simply deleting /etc/acpi/events/powerbtn.)
if [ -f /etc/acpi/events/powerbtn -o -f /etc/acpi/events/powerbtn.dpkg-bak ] ; then
logger Acpi-support not handling power button, acpid handler exists at /etc/acpi/events/powerbtn or /etc/acpi/events/powerbtn.dpkg-bak.
exit 0
fi
[ -e /usr/share/acpi-support/policy-funcs ] || exit 0
. /usr/share/acpi-support/policy-funcs
if CheckPolicy; then
exit 0
fi
if [ -x /etc/acpi/powerbtn.sh ] ; then
# Compatibility with old config script from acpid package
/etc/acpi/powerbtn.sh
elif [ -x /etc/acpi/powerbtn.sh.dpkg-bak ] ; then
# Compatibility with old config script from acpid package
# which is still around because it was changed by the admin
/etc/acpi/powerbtn.sh.dpkg-bak
else
# Normal handling.
/sbin/shutdown -h -P now "Power button pressed"
fi上周安装了一个新的Debian客户VM,它没有关闭问题。确实存在问题的Debian是从VirtualBox迁移到KVM的,是Debian 7的旧安装。
发布于 2016-05-02 08:38:15
最近,我通过安装acpid并编辑/etc/acpi/events/powerbtn来包含action=/sbin/poweroff,从而解决了当前Ubuntu上的问题。
详细说明
发布于 2014-03-01 06:40:33
我在一个旧的vmware映像上也遇到了同样的问题,我将其转换为libvirt/KVM。它经历了许多Debian版本的升级。我尝试了所有常用的方法,检查是否在来宾中启用了acpi,并在/etc/acpi/events中创建了事件脚本。什么都没用。最后我清除了包裹。
然后,我还删除了我自己创建的其余脚本。然后我做了一个新的包安装
在安装过程中可以看到的是:
将安装以下新软件包: acpi-support-base{a} acpid控制台{a} libck-connector0{a} libpam-ck-连接器{a} libpolkit-gobject-1-0{a}
奇怪的新的依赖..。而且起作用了!
希望这对你有用!
https://serverfault.com/questions/549766
复制相似问题