Page 1 of 1

Is it possible to speed up restore time to faster than 10 minutes?

Posted: 28. Dec 2020, 18:54
by SatoriHeart
Disclaimer: I am aware that running any VM on a Windows host is mistake #1, given Windows inability to handle high workloads and its overall poorly designed system architecture. That is not the problem here (at least I don't think it is). I am just tired of saving a (Ubuntu 18.04) VM image and then waiting 10+ minutes for it to restore every time. We never had this problem running Windows guests on Linux hosts. Only the other way around.

If I shut it down and restart, it loads in less than a minute. Saves / restores, on the other hand, take forever. What can be done about this? I don't have the time to port everything over to VMWare, so hopefully, there is a way to improve restore speed. The host has 16-cores, AMD Threadripper, 64Gb of memory and multi-gigabytes of available SSD storage. I don't see a reason why this should be so slow, apart from the fact that Windows 10 is the host and slows nearly everything down 10x, minimum, compared to our Linux hosts. That's a side issue.

Re: Is it possible to speed up restore time to faster than 10 minutes?

Posted: 28. Dec 2020, 22:13
by scottgus1
SatoriHeart wrote:That's a side issue.
Unfortunately that could be the very issue. I run a Windows 10 host and don't have long save-states ("restores") but I don't have a Linux host to compare save-state restore times, either. Windows and Linux are different architectures and may just not be able to grab several GB memory quickly.

Another consideration is that it sounds like you may have lots of stuff going on in that host PC. It may be for some reason that the memory is fragmented, and VMs need contiguous memory chunks, so some defragmenting might be needed ahead of time.

If you have large RAM settings on the VMs, it could be that all that RAM has to be loaded to the SSD and back when the VM is being save-stated and restored. Other throughput on the SSD might interfere, too.

All of this is theory, unfortunately. Others than I might have insights. It would be interesting to install Linux on a different host drive, boot that monster into your favorite Linux flavor, register the VMs (not while save-stated, they'd have to be fully shut down to survive the host OS change) and see how save-state restore performance compares.

Just out of curiosity, why do you save-state & restore rather than regular shutdown and reboot? (FWIW a fully-shut-down VM is in proper state for backup and restore to any compatible host. A save-stated VM is locked to the exact host, host hardware condition, and Virtualbox version it was save-stated on. So a backup routine that depends on save-state is doomed to failure.)

Re: Is it possible to speed up restore time to faster than 10 minutes?

Posted: 29. Dec 2020, 01:20
by fth0
scottgus1 wrote:I run a Windows 10 host and don't have long save-states ("restores") but I don't have a Linux host to compare save-state restore times, either.
I have a Lenovo T590 notebook set up as a dual-boot system with Windows 20H2 and Linux Mint 20, VirtualBox 6.1.16 installed in both, and a Windows 20H2 VM and a Linux Mint 20 VM in each. Restoring from a saved-state takes approximately 10 seconds in all 4 combinations. Generally speaking, VirtualBox VMs running on the Windows host are roughly between 10 and 20 percent slower than when running on the Linux host in my setups, so differences are barely noticeable.
SatoriHeart wrote:Saves / restores, on the other hand, take forever. What can be done about this?
The first step would be to find out the root cause. If you have any security software running on your Windows host, disable or even better uninstall it for a test. Please provide a zip file containing the VBox.log file and the VBoxHardening.log file of a complete run of the VM beginning with a saved-state and ending with a saved-state or shutdown.

Re: Is it possible to speed up restore time to faster than 10 minutes?

Posted: 12. Jan 2021, 11:01
by Petr Vones
Same problem. AMD Ryzen 5 3600, 32 GB RAM, Samsung 980 Pro SSD. Windows 10 20H2 on both host and guest, no thirdparty antivirus crap. VirtualBox and virtual machine folders are excluded from Windows Defender scan. VirtualBox 6.1.16, no extension pack, no USB support installed.

Virtual machine has 16 GB RAM assigned. Restoring the virtual machine takes between 30 seconds and 3 minutes. There is very low CPU usage and very low disk read speed (about 30 times slower than the SSD maximum read speed is) during the restore. So it isn't limited by the hardware. It seems to get worse as the host is hibernated frequently (a memory fragmentation?). Note I never hibernate the host when a virtual machine is running, I save its state first.

Log file attached.

Re: Is it possible to speed up restore time to faster than 10 minutes?

Posted: 12. Jan 2021, 19:25
by fth0
In the VBox.log file, there are several messages showing that the Time Manager (TM) is missing 60 of 120 seconds of elapsed time, and that the total time missing is approximately 6 hours. I don't know the reason, but for an analysis it would be necessary to have a VBox.log file of a run from a full shut down state up to a saved state, and another one from this saved state up to either another saved state or another full shutdown state, so that the VBox.log files contain the statistics at their end.