Page 1 of 1

[Fixed] Virtualbox 5 and 6 wake Windows 10 from standby mode (#18549)

PostPosted: 4. Apr 2019, 01:14
by blubbb

ModEdit; related ticket: #18549: Windows host wakes from standby mode constantly => Fixed in SVN

Hi,

after upgrading to Windows 10 I noticed that Virtualbox wakes the system from standby mode after few(!) seconds to minutes. I tried both versions 5 and 6.

My questions:
Why is it waking Windows? It does not make sense to me.
How do I disable this behaviour of Virtualbox?

Note that I need wake timers for other purposes, so I cannot disable them system wide.

Thanks.

Re: Virtualbox 5 and 6 wake Windows 10 from standby mode

PostPosted: 4. Apr 2019, 02:07
by socratis
blubbb wrote:Why is it waking Windows? It does not make sense to me.
Because a "computer" is running? Your VM?

blubbb wrote:How do I disable this behaviour of Virtualbox?
Shut down the VM. It's not a good idea to put a VM to sleep...

Re: Virtualbox 5 and 6 wake Windows 10 from standby mode

PostPosted: 4. Apr 2019, 10:32
by blubbb
Our old installation had no problems with the vm in the background while sleeping. Why should this be the case anyway? It is as if just pausing it.

And with the default settings in Windows, wakeups do not work at all! Neither for Vbox nor for other programs. So my guess is, 99% of the users do not end their vms before putting the host to sleep. It just continues to "work" in the background.

Looks like a bug to me.

Re: Virtualbox 5 and 6 wake Windows 10 from standby mode

PostPosted: 4. Apr 2019, 11:19
by andyp73
blubbb wrote:after upgrading to Windows 10

After upgrading what - host or guest?

blubbb wrote:Looks like a bug to me.

As Windows 10 is the most common (probably) host and guest used with VirtualBox if this was a bug then there would likely be many more reports of the problem. As there aren't for the time being it is classified as "an isolated incident with a single user that needs further investigation". Less snappy than "bug" but more accurate! :)

We are going to need a much better description of your setup, how the problem manifests itself, anything that can be done to provoke it, etc.

-Andy.

Re: Virtualbox 5 and 6 wake Windows 10 from standby mode

PostPosted: 4. Apr 2019, 11:31
by blubbb
Host: Windows 10 Pro 64
Guest: Ubuntu 16 LTS

Steps to reproduce problem:
- In Windows' power options / sleep / allow wake timers / set this to "enable" (I would link to an image but the forum does not permit this)
- Start guest system
- Hit sleep button on host system

Problem:
- The host wakes up after a few seconds/minutes.

Execute
powercfg /lastwake
You will see that VBoxSVC.exe was the cause.

Re: Virtualbox 5 and 6 wake Windows 10 from standby mode

PostPosted: 4. Apr 2019, 11:34
by blubbb
We need to set this to "enable" to use our other wake timers on the host system.

Re: Virtualbox 5 and 6 wake Windows 10 from standby mode

PostPosted: 4. Apr 2019, 21:00
by blubbb
I know a bit or two about the WinAPI and browsed through your source code. The problem most probably is here:
https://www.virtualbox.org/browser/vbox ... n.cpp#L192

Line 192. You are calling SetWaitableTimer with last parameter true. The last parameter is whether or not to resume the system. This results exactly in the described behaviour.

https://docs.microsoft.com/en-us/window ... tabletimer

Re: Virtualbox 5 and 6 wake Windows 10 from standby mode

PostPosted: 5. Apr 2019, 16:36
by mpack
IMHO, this kind of information would be better placed in a BugTracker ticket where the devs are likely to see it, rather than a user level discussion topic.

Re: [Fixed] Virtualbox 5 and 6 wake Windows 10 from standby mode (#18549)

PostPosted: 10. Apr 2019, 09:53
by socratis
Added ticket information and marked as [Fixed], as per the resolution of ticket #18549.

Excellent work there @blubbb!!! 8)