setting to trigger VM power cycle when guest OS reboots?

Jul 28, 2025
6
1
3
southern Germany
Hi
we're currently in the progress of moving from vmware to Proxmox. We mostly host VMs for other teams that are responsible for server and application.

On vmware there was a handy setting "vmx.reboot.powercycle" that I could set after doing changes, which enabled the hypervisor to recognize a guest OS reboot (via vmware tools agent) and do the powercycle on the VM process. So the responsible teams (without access to the hypervisor) could decide, when they reboot their server and activate the new settings/hardware/etc.

Does anyone know if there's a similar setting/command on Proxmox VE using qemu guest tools?

add. Info:
https://www.reddit.com/r/vmware/comments/edjk4o/power_cycle_on_reboot_advanced_setting_finally/
https://williamlam.com/2022/09/power-off-vm-from-guest-os-reboot-capability-in-vsphere-8.html
 
  • Like
Reactions: leesteken
On vmware there was a handy setting "vmx.reboot.powercycle" that I could set after doing changes, which enabled the hypervisor to recognize a guest OS reboot (via vmware tools agent) and do the powercycle on the VM process. So the responsible teams (without access to the hypervisor) could decide, when they reboot their server and activate the new settings/hardware/etc.

If I understand you correctly, it isn't about the authorization to restart the VM (Qemu process), but that you can schedule it automatically at a specific time without having root privileges?
 
If I understand you correctly, it isn't about the authorization to restart the VM (Qemu process), but that you can schedule it automatically at a specific time without having root privileges?
not at a specific time, I just want the hypervisor to trigger a powerOff/powerOn when the guestOS reboots. I.e. the hypervisor should recognize (via qemu guest tools) when a reboot is triggered in-guest.
 
I didn't knew the vmx.reboot.powercycle flag but I can see the usefulness in this. I have emulated this kind of behaviour in my VMs by having them set to HA (specifically to restart if stopped), so I just poweroff the machine and it'll be started again by HA (much slower than just a reboot however). This does also not involve the default reboot process, so this is not a fully emulation of what you want.

Alternatively, after changing the hardware, you can just trigger a reboot over the PVE UI which will powercyle the VM to activate the new hardware, you don't need to stop / start after the changes. I didn't check if those are different permissions, but if a user has the permission to change hardware, I would assume the user also has the right to power-cycle the VM.
 
Alternatively, after changing the hardware, you can just trigger a reboot over the PVE UI which will powercyle the VM to activate the new hardware, you don't need to stop / start after the changes. I didn't check if those are different permissions, but if a user has the permission to change hardware, I would assume the user also has the right to power-cycle the VM.
That's the problem. I (infrastructure admin) have the (technical) permissions to change hardware and trigger reboot via PVE UI, but I don't have the organizational permission to do a reboot when I want it. So we have to let the VM/Application owners decide when they can do a reboot, but they don't have access to PVE UI, only to their guest OS (or we wait for the next auto reboot by OS updates, but the guestOS update service also can't access PVE UI).
 
Last edited:
I could see that being handy…maybe add to the bugzilla site as a suggestion if it is new.

It’s not what you asked but I expect you should be able to grant permission in PVE to just their VM so they can do the shutdown.
 
Maybe a work-around could be made with the reboot VM configuration setting to make the VM stop when it reboots from inside. But you'll have to make sure Proxmox starts it again (automatically), but maybe HA does that already? I also think that your suggestion would be useful and maybe the admin should be able to chose between once and always. Please add it to bugzilla.proxmox.com.
 
I didn't knew the vmx.reboot.powercycle flag but I can see the usefulness in this. I have emulated this kind of behaviour in my VMs by having them set to HA (specifically to restart if stopped), so I just poweroff the machine and it'll be started again by HA (much slower than just a reboot however). This does also not involve the default reboot process, so this is not a fully emulation of what you want.
Very good idea!

@mskfm
Another option would be to develop access via the Proxmox API. This would allow you to trigger specific commands. It is more work, of course. But it is future-proof.
 
Maybe a work-around could be made with the reboot VM configuration setting to make the VM stop when it reboots from inside. But you'll have to make sure Proxmox starts it again (automatically), but maybe HA does that already? I also think that your suggestion would be useful and maybe the admin should be able to chose between once and always. Please add it to bugzilla.proxmox.com.
which command do you mean on this linked site? Do you think "qm set --reboot 0" (Allow reboot. If set to 0 the VM exit on reboot.) will do "VM stop when it reboots from inside"?

@fireon that would mean educating many Windows-endusers that they can't use Start>Reboot anymore but have to use an API or other tooling, I want to avoid that ;)

I'll give the "tell them to shutdown instead of reboot and trust HA" a try...

edit: My first feature request, feedback appreciated if I should add/correct something https://bugzilla.proxmox.com/show_bug.cgi?id=7213
 
Last edited:
which command do you mean on this linked site? Do you think "qm set --reboot 0" (Allow reboot. If set to 0 the VM exit on reboot.) will do "VM stop when it reboots from inside"?
Yes, that's how I also interpret it: the user(s) inside the VM can then decide when to shut down or reboot and the VM will then stop (gracefully). What is missing is that Proxmox starts the VM again.
 
Results of my tests for workaround (I choose disabling/enabling NUMA as example setting that needs a reboot):
1. "qm set <vmid> --numa 0 --reboot 0" and then reboot in-guest does not powercycle the VM, new config still displayed red in hardware-tab.
2. "qm set <vmid> --numa 0 --reboot 1" and then reboot in-guest does not powercycle the VM, new config still displayed red in hardware-tab.
3. enabling HA and then shutdown in-guest does powercycle the VM as HA directly starts it after shutdown, which will enable the setting.

So 3. is a workaround if I can convince the users to use shutdown and trust my assurance that it will be started automatically...

edit: "qm set --reboot 0" also needs a powercycle to be enabled. So:
1. "qm set <vmid> --reboot 0", then shutdown/powerOn, then "qm set <vmid> --numa 1" and then reboot in-guest does powercycle the VM. Would mean that all my existing VMs need a powercycle first to enable reboot=0... and if someone forgets to enable HA when creating a VM, it will always shutdown instead of reboot
 
Last edited:
I found that when reboot: 0 is in the VM configuration file when it is started (the reboot setting cannot be applied on the fly, which is a small disappointment), the VM does a shut down instead of a reboot. Changes to the VM configuration are applied (just) before starting that VM again (from Proxmox web GUI or command line).
If Proxmox starts the VM automatically (because of HA) that is a work-around. But then you could also ask the user(s) to shut down the VM instead of rebooting from the inside.