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!
Save VM State during Windows Update restarts
-
Martin
- Volunteer
- Posts: 2567
- Joined: 30. May 2007, 18:05
- Primary OS: Fedora other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: XP, Win7, Win10, Linux, OS/2
Re: Save VM State during Windows Update restarts
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.
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
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.
.
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
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
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
-
mpack
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Mostly XP
Re: Save VM State during Windows Update restarts
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.AndyCot wrote:It's gotten allot better over the years and reboots happen allot less than in Win3.1
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).
-
scottgus1
- Site Moderator
- Posts: 20945
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows, Linux
Re: Save VM State during Windows Update restarts
Amen to that! Preach it, brother!AndyCot wrote:You are better to disable automatic Windows updates and run the check manually once a week after you shutdown the VM's.
@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.
Re: Save VM State during Windows Update restarts
Doing a search doesn't find any solutions for this problem, nor any further discussion, so I thought I'd try refreshing it.
I copied my VirtualBox VM to HyperV, and noticed that HyperV is able to save the VM (Linux) running state when Windows auto-restarts, both on Win10 and Win11 (this has saved me many times). So there must be some way to make Windows pause a restart long enough to allow a VM to save it's state (or, I guess, HyperV could just have a special relationship with Windows, since it is natively supported). This has unfortunately turned me away from VirtualBox, but I miss having the conveniences of VirtualBox guest additions and wish they had a solution for this (HyperV doesn't have any USB forwarding support).
I copied my VirtualBox VM to HyperV, and noticed that HyperV is able to save the VM (Linux) running state when Windows auto-restarts, both on Win10 and Win11 (this has saved me many times). So there must be some way to make Windows pause a restart long enough to allow a VM to save it's state (or, I guess, HyperV could just have a special relationship with Windows, since it is natively supported). This has unfortunately turned me away from VirtualBox, but I miss having the conveniences of VirtualBox guest additions and wish they had a solution for this (HyperV doesn't have any USB forwarding support).
Re: Save VM State during Windows Update restarts
The problem I have is I have UPS to shutdown the PC/Server but you can't give it a script as to what to do but windows does have log off and shutdown scripts it can run but they don't work with VirtualBox and I think the reason is VirtualBox really dose not what you to log off or shutdown your PC/Server which in a way is good but then can't use windows log off and shutdown scripts so if VirtualBox was like a notepad then windows log off and shutdown scripts should run to do like VBoxManage controlvm "home assistant" savestate in a .bat file in C:\Program Files\Oracle\VirtualBox\