Detecting in Host when Guest OS is turning off screen ?

This is for discussing general topics about how to use VirtualBox.
Post Reply
Nicolas-MEAE
Posts: 8
Joined: 25. May 2022, 09:21

Detecting in Host when Guest OS is turning off screen ?

Post by Nicolas-MEAE »

Hi !

I am using a debian 11 host, vbox 7.0.8 and Windows 10 guest.

In the W10 guest, there is some powersaving functionnality to "turn off screen" after some "idle" delay. When that happens (Windows guest OS trying to turn the screen off), the vbox screen just stops "updating" (freezes) bug doesn't go dark like on a real machine.

This is fine.

However, would there be a way, from the host, to detect those "turn the screen on / off" events sent from the guest OS ? Maybe using some kind of vboxmanage command ? (So far I tried vboxmanage showvminfo ; vboxmanage guestproperty enumerate ; vboxmanage getextradata - without finding or seeing this screen power state information).

Any help appreciated !

Thanks
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Detecting in Host when Guest OS is turning off screen ?

Post by scottgus1 »

There aren't any ways for the host Virtualbox to see the VM's screen turn-off that I know about.

You should not use any power or screen turn-off settings in the VM OS. Let the host handle the power settings. The VM should stay on and enabled the whole time while it is running. Otherwise failures and data loss can happen.
Nicolas-MEAE
Posts: 8
Joined: 25. May 2022, 09:21

Re: Detecting in Host when Guest OS is turning off screen ?

Post by Nicolas-MEAE »

Thank you @scottgus1 !

In fact I was not trying to make some powersavings, but to properly detect inactivity from the host on the guest side (better that the guestproperty "UsageState" that is in fact just telling us if the mouse / keyboard are beeing used as far as I understand). Only the guest can really know its own activity if I get it well. For an example if the "user" is watching a video Vbox will see as "Idle" (no mouse / keyboard) but it would be inaccurate.

I might try instead to use some Windows Task scheduler script to update a guestproperty for the host to access...

Best regards,
Post Reply