How to disable Virtualbox auto-close
The manual contains:
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 preperation of a potential host power down.
The behavior can be configured. By executing the following command, no VM is saved:
 VBoxManage setextradata global &quot;VBoxInternal2/SavestateOnBatteryLow&quot; 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 &quot;VBoxInternal2/SavestateOnBatteryLow&quot; 1
 VBoxManage setextradata &quot;foo&quot; &quot;VBoxInternal2/SavestateOnBatteryLow&quot; 0

The first line is actually not required as by default the savestate action is performed.