Page 1 of 1

Save VM State during Windows Update restarts

Posted: 21. Dec 2018, 11:39
by Pedritux
It has happened several times, and again tonight (Virtualbox 5.2.22) , so I'd thought I'd post it, as I did not see it referenced here or in the changelog for 6.0.0

Summary: When an Windows Update installation occurs, it triggers an automatic restart, the host is usually unattended (overnight), VirtualBox is closed and it does not save its running VM states, when it has VMs running. Suggestion: Implement the feature "Save VM state in case of host restart" in the GUI.

I understand that the Host OS might not wait for the VM Save to finish, and that would create a big problem.

Found more people talking about the same problem, and some implementing workarounds for this with scripts.
Example on superuser: virtualbox-windows-graceful-shutdown-of-guests-on-host-shutdown

Merry Xmas!

Re: Save VM State during Windows Update restarts

Posted: 21. Dec 2018, 12:18
by Martin
Unfortunately there is technically no way to implement this reliably because saving all running VMs could take longer than Windows allows a process to stall the shutdown process.
If a process doesn't close after a fixed time it just gets killed by Windows shutdown.

Re: Save VM State during Windows Update restarts

Posted: 8. Dec 2021, 06:57
by fervor
This just happened to me again tonight. Windows Update smokes my running VMs about once every 3 months when I don't catch the process in time. I've been looking for a way to automatically save the VM state before a Windows update for a long time. I've had no luck finding a good magic trick that can:
A) Catch the update process in the act.
B) Delay the update restart long enough to finish the save.
:/
I will keep looking.
.

Re: Save VM State during Windows Update restarts

Posted: 8. Dec 2021, 09:10
by AndyCot
You are better to disable automatic Windows updates and run the check manually once a week after you shutdown the VM's.

If you leave Windows automatic updates on you will continue to have problems as MS think they own the computer. It's gotten allot better over the years and reboots happen allot less than in Win3.1

Re: Save VM State during Windows Update restarts

Posted: 8. Dec 2021, 11:53
by mpack
AndyCot wrote:It's gotten allot better over the years and reboots happen allot less than in Win3.1
Due to Windows Update? I think not. The Internet barely even existed in the Win3 era, people typically had 14.4K dialup modems (if they were lucky) to call up FIDOnet boards.

IIRC, automatic Windows Updates were introduced in WinME, then retrofitted to Win9x. Never existed in Windows 3.1, which was long dead by then (completely replaced by Win95).

Re: Save VM State during Windows Update restarts

Posted: 8. Dec 2021, 15:46
by scottgus1
AndyCot wrote:You are better to disable automatic Windows updates and run the check manually once a week after you shutdown the VM's.
Amen to that! Preach it, brother! :D

@fervor, If you value your VMs, or even want to backup the host beforehand, disable automatic reboot for Windows Updates, or even automatic install. If you're running Pro, the Group Policy Editor can do this easily:

Run... > gpedit.msc > Local Computer Policy > Administrative Templates > Windows Components > Windows Update > Configure Automatic Updates > set "Configure automatic updating" dropdown to 2 (Notify for download and auto install) or possibly 3 (Auto download and notify for install).

I have my 10 Pro workstation set to #2. I get notifications for updates, but they don't install until I click the button. This gives me time to see if Update Tuesday's releases blow up the internet with one of MS's somewhat rare but infamous bunged updates, and to make host backups, verify the RAID mirror, and shut down important programs first.

It may be possible to apply the registry changes et al to a non-GPE-enabled 10 Home etc PC, some web-searching could find out how to do it.