Some host power management events are handled by VirtualBox. The actual behavior depends on the platform:
- Host Suspends
-
This event is generated when the host is about to suspend, that is, the host saves the state to some non-volatile storage and powers off.
This event is currently only handled on Windows hosts and Mac OS X hosts. When this event is generated, VirtualBox will pause all running VMs.
- Host Resumes
-
This event is generated when the host woke up from the suspended state.
This event is currently only handled on Windows hosts and Mac OS X hosts. When this event is generated, VirtualBox will resume all VMs which are where paused before.
- Battery Low
-
The battery level reached a critical level (usually less than 5 percent charged).
This event is currently only handled on Windows hosts and Mac OS X hosts. When this event is generated, VirtualBox will save the state and terminate all VMs in preparation of a potential host powerdown.
The behavior can be configured. By executing the following command, no VM is saved:
VBoxManage setextradata global "VBoxInternal2/SavestateOnBatteryLow" 0
This is a global setting as well as a per-VM setting. The per-VM value has higher precedence than the global value. The following command will save the state of all VMs but will not save the state of VM "foo":
VBoxManage setextradata global "VBoxInternal2/SavestateOnBatteryLow" 1 VBoxManage setextradata "foo" "VBoxInternal2/SavestateOnBatteryLow" 0
The first line is actually not required as by default the savestate action is performed.