Share via

Preventing system sleep ONLY while Hyper-V VM is running

Anonymous
2024-04-17T06:01:53+00:00

Looking for a way to tell the Host Windows 11 OS to not sleep while a Hyper-V VM is running. Powercfg /requestsoverride does literally nothing. I've tried; (vmwp.exe is the VM worker and is running while the VM is, mmc.exe is the management interface for Hyper-V)

  1. powercfg /requestsoverride process "C:\Windows\System32\vmwp.exe" system
  2. powercfg /requestsoverride process "C:\Windows\System32\vmwp.exe" system display
  3. powercfg /requestsoverride service "C:\Windows\System32\vmwp.exe" system
  4. powercfg /requestsoverride service "C:\Windows\System32\vmwp.exe" system display
  5. powercfg /requestsoverride driver "C:\Windows\System32\vmwp.exe" system
  6. powercfg /requestsoverride driver "C:\Windows\System32\vmwp.exe" system display
  7. powercfg /requestsoverride process "C:\Windows\System32\mmc.exe" system
  8. powercfg /requestsoverride process "C:\Windows\System32\mmc.exe" system display
  9. powercfg /requestsoverride service "C:\Windows\System32\mmc.exe" system
  10. powercfg /requestsoverride service "C:\Windows\System32\mmc.exe" system display
  11. powercfg /requestsoverride driver "C:\Windows\System32\mmc.exe" system
  12. powercfg /requestsoverride driver "C:\Windows\System32\mmc.exe" system display

The goal is basically while the VM is running it shows up in the output of Powercfg /requests without the need for external programs, continually running scripts, or changing of power plans. I want the system to behave absolutely normal when the VM is not running.

***moved from Windows / Windows 11 / Sleep and Power on, off***

Windows for business | Windows Client for IT Pros | Storage high availability | Virtualization and Hyper-V

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Anonymous
    2024-04-20T10:54:31+00:00

    Hi ETHREAL1,

    If you are using a laptop you could trigger presentation settings

    Manual activation can be done by right-click on start then choose mobility center & turn on presentation mode, this will override power savings

    This can also be activated through CLI with presentationsettings /start or /stop

    you could use this PowerShell script to check & trigger it

    #check if any vm is running $vm = Get-VM | Where-Object {$_.State -eq 'Running'}#start presentation mode if vm is runningif ($vm) {Write-Host "A virtual machine is currently running - turning on presentation settings."PresentationSettings.exe /start} else {Write-Host "No virtual machines are currently running - turning off presentation settings."PresentationSettings.exe /stop}

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2024-04-19T05:06:28+00:00

    Hi ETHREAL1,

    You can give a try to the PowerToys Awake utility. Use the --pid argument to attach the execution of Awake to a the vmwp process to keep the computer awake when vmwp is running.

    PowerToys Awake utility for Windows | Microsoft Learn

    Was this answer helpful?

    0 comments No comments