1

I have KVM installed and working on my Debian 7.1 host with two Debian 7.1 guests and some Windows XP guests. When I shutdown using the command 'virsh shutdown ' or hitting the shutdown button in virt-manager the Debian guests go into pmsuspended state.

The only way I can properly shutdown is to ssh into those guests and type the 'shutdown -h now' command.

On both debian guests I have these packages installed and running:

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

Here is the events of my acpid on my debian guest:

:/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

Update

Installed a new Debian guest VM last week and it doesn't have the shutdown problem. The Debian VMs which do have the problem were moved from VirtualBox to KVM and are older installations of Debian 7.

4
  • Do any of these files exist: /etc/acpi/events/powerbtn, /etc/acpi/events/powerbtn.dpkg-bak, /etc/acpi/powerbtn.sh, /etc/acpi/powerbtn.sh.dpkg-bak?
    – sciurus
    Feb 26, 2014 at 1:52
  • No they don't, but there are /etc/acpi/powerbtn-acpi-support.sh, /etc/acpi/power.sh and /etc/acpi/events/powerbtn-acpi-support files
    – map7
    Feb 26, 2014 at 2:52
  • did you tried to disable acpi in your guest?
    – c4f4t0r
    Feb 27, 2014 at 14:40
  • No I haven't I want to be able to shutdown the VM using the virtual machine manager
    – map7
    Feb 28, 2014 at 1:09

2 Answers 2

1

I've recently solved the problem on current Ubuntu by installing acpid and editing /etc/acpi/events/powerbtn to contain action=/sbin/poweroff.

detailed instructions

2

I had the same problem on an old vmware image which I converted to libvirt/KVM. It has survived many Debian version upgrades. I tried all the usual, check that acpi was enabled in the guest and created event scripts in /etc/acpi/events. Nothing worked. Finally i purged the package.

aptitude purge acpid

then I also deleted the remaining scripts I created my self. Then I did a fresh packet install

aptitude install acpid

What could be seen during install was:

The following NEW packages will be installed: acpi-support-base{a} acpid consolekit{a} libck-connector0{a} libpam-ck-connector{a} libpolkit-gobject-1-0{a}

Strange, new dependencies... And it worked!

Hope this works for you to!

2
  • It's still showing up as 'pmsuspended' after doing this.
    – map7
    Mar 2, 2014 at 23:55
  • With APT::Install-Recommends "false"; (or corresponding option in aptitude config) you'll need to install acpi-support-base to get /etc/acpi/events/powerbtn-acpi-support; as acpi-support-base depends on acpid one could simply go for apt install acpi-support-base.
    – Stefan
    Apr 18, 2021 at 8:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .