AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 549766
Accepted
map7
map7
Asked: 2013-10-31 15:13:07 +0800 CST2013-10-31 15:13:07 +0800 CST 2013-10-31 15:13:07 +0800 CST

安装了 acpi 的 KVM 来宾不会关闭

  • 772

我已经安装了 KVM,并在我的 Debian 7.1 主机上运行,​​其中有两个 Debian 7.1 来宾和一些 Windows XP 来宾。当我使用命令 'virsh shutdown' 关闭或点击 virt-manager 中的关闭按钮时,Debian 来宾进入 pmsuspended 状态。

我可以正确关闭的唯一方法是通过 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

这是我的 acpid 在我的 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 VM 已从 VirtualBox 移至 KVM,并且是 Debian 7 的较旧安装。

kvm-virtualization
  • 2 2 个回答
  • 11099 Views

2 个回答

  • Voted
  1. Stenborg
    2014-03-01T22:40:33+08:002014-03-01T22:40:33+08:00

    我在转换为 libvirt/KVM 的旧 vmware 映像上遇到了同样的问题。它在许多 Debian 版本升级中幸存下来。我尝试了所有常规方法,检查来宾中是否启用了 acpi,并在 /etc/acpi/events 中创建了事件脚本。没有任何效果。最后我清除了包裹。

    能力清除酸

    然后我还删除了我自己创建的剩余脚本。然后我做了一个全新的数据包安装

    aptitude 安装 acpid

    在安装过程中可以看到的是:

    将安装以下新软件包:acpi-support-base{a} acpid consolekit{a} libck-connector0{a} libpam-ck-connector{a} libpolkit-gobject-1-0{a}

    奇怪的,新的依赖...而且它奏效了!

    希望这对你有用!

    • 2
  2. Best Answer
    binary_runner
    2016-05-03T00:38:15+08:002016-05-03T00:38:15+08:00

    我最近通过安装 acpid 并编辑/etc/acpi/events/powerbtn以包含action=/sbin/poweroff解决了当前 Ubuntu 上的问题。

    详细说明

    • 1

相关问题

  • Xen 与 KVM 的性能对比

  • 什么是bridge_fd?

  • 如何在 kvm-linux 中登录除 ssh、vnc 之外的控制台

  • Linux 内核虚拟机

  • Vista 上的 VNC

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve