我安装了KVM,并在Debian 7.1主机上安装了两个Debian 7.1来宾和一些Windows XP来宾。 当我使用命令“virsh shutdown”关机或者在virt-manager中关机时,Debian客户端进入pmsuspended状态。
我可以正常closures的唯一方法是ssh到这些客人,键入“shutdown -h now”命令。
在这两个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客人的acpid事件:
:/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访客虚拟机,它没有closures的问题。 有问题的Debian虚拟机已经从VirtualBox迁移到KVM,并且是Debian 7的老版本。
我最近通过安装acpid和编辑/ etc / acpi / events / powerbtn来包含action = / sbin / poweroff来解决当前Ubuntu上的问题。
详细的说明
我在转换为libvirt / KVM的旧版vmware映像上遇到同样的问题。 它经历了许多Debian版本的升级。 我尝试了所有常用的方法,检查客户端是否启用了acpi,并在/ etc / acpi / events中创build了事件脚本。 没有工作。 最后我清理了包裹。
性能清除acpid
那么我也删除了我自己创build的其余脚本。 然后我做了一个新的数据包安装
aptitude安装acpid
在安装过程中可以看到的是:
将安装以下新软件包:acpi-support-base {a} acpid consolekit {a} libck-connector0 {a} libpam-ck-connector {a} libpolkit-gobject-1-0 {a}
奇怪,新的依赖关系…它的工作!
希望这对你有用!