script to shutdown VM on power button press

kisiel

New Member
May 13, 2023
22
0
1
Hi. I use Mac vm (no guest agent).
My idea is that when I press power button proxmox could send shutdown command to OSX via ssh.
This would should allow to close mac vm gracefully.
I am not sure what is happening now, but I have a feeling that mac simply sees it as yanking the cable off the mains.

any ideas?
 
Should be doable with acpid.

Shutting down a VM should also be possible without the guest agent. You can always send a ACPI shutdown to the KVM process and the guest OS could respond to that. Needs checking on MacOS, yet in theory it could work.
 
so you mean that MacOS should close down gracefully just based on ACPI shutdown signal.
you might be right, I am not sure how to prove it though
 
Simple, close down all programs on your mac-vm, then within proxmox press the shutdown or restart option (NOT stop/reset) while looking at the console. If you see if it shutting down cleanly and it also starts up without error there, you should be good with the power-button too. If not, you've got to "fix" your mac-vm first.

(the closing down programs is so that IF it does crash, the chance of any corruption is negligible low, but if you want to be extra sure, make a snapshot/clone first)
 
Last edited:

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!