timsutton / osx-vm-templates

macOS templates for Packer and VeeWee.
MIT License
1.13k stars 248 forks source link

Prevent OSX guests going into suspend automatically #67

Open dazwin opened 8 years ago

dazwin commented 8 years ago

I'm running Parallels but I suspect OSX power management is putting the guest into suspend for all providers. This is not the default behavior for other boxes I know of - can it be turned off as part of prepare_iso.sh?

timsutton commented 8 years ago

I forget if some of the options need to be adjusted for VMs or not, but the proper way to change energy saver settings is the pmset command, run as root, from the booted OS.

So perhaps adding another provisioning script that just calls pmset sleep 0 (disabling sleep) would suffice. I'm not entirely sure that there aren't some other options that would be needed, but in my workplace where we manage physical Macs this one command seems to take care of preventing sleep.