more graceful shutdown of VirtualBox jail

Status
Not open for further replies.

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
The VirtualBox jail is a wonderful thing, but more than once I've forgotten to shut down a running VM when restarting my FreeNAS box (e.g. when doing a System Update). Is there any chance the VirtualBox jail could attempt to do a Save State or ACPI Shutdown of any running VMs when it gets shut down?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I tried to do a "save state" type function, but the problem is that if it takes too long then the shutdown sequence kills the process due to the timeout anyway. So unless you have a VM that is very small (think less than 1GB of RAM, etc.) you'll end up with incompletely saved save states. ACPI shutdowns come with the same perils.

There also is no direct mechanism to tell a process inside the jail to shutdown before the jail receives the shutdown message. So you have technical limitations that I would likely never have been able to overcome without reworking the shutdown code (and that's not something that really should be touched).
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
I figured it would be non-trivial. As it happens my VMs are less than 1GB of RAM (just little Ubuntu servers for website development), but I realize one use case doesn't make a solution.

I haven't lost any data yet, just ended up with aborted VMs.

Very useful jail anyway, thanks!
 
Status
Not open for further replies.
Top