Programmatically keeping the VM screen on

A while I ago I did a blog post on how Windows will "turn off" our virtual computer screen to "save energy" (you can read about it here).  Recently, I was contacted by a team inside Microsoft who wanted to figure out how to stop this from happening - programmatically.

Their problem was that they were using our Thumbnail API (you can read about it here) to grab copies of the virtual machine screen - and were frustrated when it stopped updating.  Thankfully - the solution was easy:

  • For Windows virtual machines - run: "powercfg /setacvalueindex SCHEME_CURRENT SUB_VIDEO VIDEOIDLE 0" inside the virtual machine
  • For Linux virtual machines - run: "xset s off" inside the virtual machine

Now the screen will always be on, and the thumbnail will always be up-to-date.

Cheers,
Ben

Comments

  • Anonymous
    June 09, 2015
    Dear Ben, talking about the screen of a HyperV-VM - I am aware that HyperV's focus is servers, but why is it that good display support is apparently so under-emphasized -  I am currently running a Windows 7 guest on Windows 10 Host (MacBook Pro Retina) and I hardly can read anything of the Windows 7 VMs display output - there is apparently no display scaling - or am I missing something?? Best Claus