OpenWrt VM: reboot, shutdown not working

TheHellSite

Active Member
Mar 4, 2020
78
39
38
I have successfully setup an OpenWrt VM on my proxmox node.

The only issue I have left are the acpid commands to shutdown / reboot the VM from proxmox-ui.
I always get "TASK ERROR: VM quit/powerdown failed - got timeout" if I try to reboot it.
When trying to reboot the whole node I get "VM still running - terminating now with SIGTERM ", which works.

The options "ACPI support" and "QEMU Guest Agent" are enabled in the VM settings.
I also installed the corresponding packages inside the VM.

However it is still not working!
 
Last edited:
A shutdown timeout usually means that your VM isn't responding to these signals. I'd check the OpenWRT documentation for more (often helps to not search for ACPI directly, but instead for "power button action" or similar terms).
 
this is the config file for the acpi daemon.

Code:
# This is a sample ACPID configuration

event=button/power.*
action=/sbin/poweroff

I guess I will need to configure the reboot function, am I right?
I can't try the shutdown command, because I currently don't have physical access to the node.
(By shutting down OpenWrt I will lose access to the server.)
 
Hm, the 'reboot' function on the PVE GUI actually uses the same 'poweroff' signal as a 'shutdown' (we just restart the VM after QEMU has exited).

Have you tried without the guest agent as well?

Also, you just need access to the PVE GUI, no physical access, to start a VM...
Edit: Ah sorry, misread that last part. Not a recommended setup, but if it works for you I guess that's an issue then...
 
Yes, worth a try. If you're not using it, that is.
 
So I tried it...
After disabling qemu-ga in VM options reboot and shutdown work just fine!
I also uninstalled the acpid package in OpenWrt and it still worked.

1. Is there a bug in the qemu-ga?
2. Should I reinstall the acpid in OpenWrt or is it obsolete?
 
1. Is there a bug in the qemu-ga?
No, that's how it's intended. When the GA is "enabled" in PVE, it only means that instead of sending ACPI signals we send a shutdown command via the QEMU guest agent socket. However, that requires the guest to listen on said socket, otherwise it will simply not work.

2. Should I reinstall the acpid in OpenWrt or is it obsolete?
That's a question probably better asked on OpenWrt forums. Personally I'd say if it works then that's that, but it might still be worth it to ask.
 
Depends on the guest OS. Not sure if there is a package for OpenWrt (or what the benefit of that would be on a router OS?), but if you're using Debian for example you can just install it via apt install qemu-guest-agent and it should work, provided it is enabled in PVE for the VM as well.

See here for more information.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!