I'm always wondering if power management facilities in a virtual machine is necessary?
And I'm not sure if they still function in a virtual machine.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
Strictly speaking, no you don't need
acpid in a virtual machine nor on a real system. But you should install
acpid in a VM as it typically handles the power button press which is simulated by the hypervisor if you shutdown a VM.
So for practically reasons, yes you should install acpid on a VM.
acpid doesn't really do power management
I would leave it. I believe ACPI does more than just power management. For example I believe there is a ACPI event that is sent in via the VM Host to the guests when you want them to shutdown or reboot.
Excerpt from Manual:KVM:
issue ACPI shut-down command to KVM guest, if guest does not support ACPI, command have no effect.
issue ACPI shut-down command to KVM guest, if guest does not support ACPI, command have no effect. After KVM guest is shut-downed it will be automatically started by host when shut down is complete.
It seems that on modern systems
acpid is not necessary to cleanly shutdown or reboot a virtual machine, even when the hypervisor uses ACPI. The kernel exports the power button as a input device (in
$ sudo journalctl -b 0 | grep Power kernel: input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0 ... systemd-logind: Watching system buttons on /dev/input/event0 (Power Button)
This button press in turn is handled by systemd-logind in logind-button.c.
This works for me with
virsh shutdown and
virsh reboot, in both cases I can see from the log that the server cleanly shut down
systemd-logind: Power key pressed. systemd-logind: Powering Off... systemd-logind: System is powering down.