craigr Posted September 3, 2020 Share Posted September 3, 2020 (edited) I know many people scoff at sleeping a VM, but I really want to put my Windows 10 VM's to sleep because they are constantly doing things in the background and utilizing a lot of CPU. It costs me about 50 watts to not sleep the VM and to me that is just a waste. The trouble has been how to wake them up easily without using another device. All you have to do to make the mouse and keyboard wake Windows from sleep is use evdev to pass them through instead of the Windows template. The easiest way to learn how to do this is to watch and mostly follow Spaceinvader's new tutorial on evdev: I'm sure he will fix it, but please note that Spaceinvader doesn't quite have the syntax correct in the qemu.conf. The correct syntax is in my post just below his in the linked thread. Once you get it right, your mouse and keyboard will be able to wake your Windows VM from sleep 🤩 Also, don't forget to turn "Link State Power Management" back on in the Advanced settings of the Windows 10 Power Options, otherwise your computer may just hard shutdown instead of sleep. I am finally happy! Best regards, craigr Edited September 3, 2020 by craigr 2 Quote Link to comment
JonathanM Posted September 3, 2020 Share Posted September 3, 2020 Quick question. What happens when the array is cleanly powered off, like for instance if your UPS commands a powerdown, if the VM is asleep? Quote Link to comment
craigr Posted September 3, 2020 Author Share Posted September 3, 2020 18 minutes ago, jonathanm said: Quick question. What happens when the array is cleanly powered off, like for instance if your UPS commands a powerdown, if the VM is asleep? No idea. I just did this today. I will have to test this though. I've got my UPS set to shutdown unRAID if I lose power for 10 seconds (it's not a big UPS and I have 22 drives). I don't know if unRAID would give Windows the default 60 seconds to shutdown gracefully or not. My guess is that it would try and shutdown windows gracefully, but I think that could be a problem because I don't want my UPS to have to work for an extra 60 seconds shutting down Windows. I also doubt Windows could wake from sleep and then shutdown in less than 60 seconds... than again, unRAID may not even know to wake a sleeping VM to shut it down gracefully 😬 I'd actually rather unRAID just yank Windows with a hard shutdown. The next time I have to power down the server I will pull the power on the UPS with Windows asleep and see what happens under controlled conditions. I'll report back with results. I know I am going to be doing some hardware changes next Tuesday or Wednesday so I'll find out then or before. Kind regards, craigr Quote Link to comment
craigr Posted September 3, 2020 Author Share Posted September 3, 2020 Also, don't forget to turn "Link State Power Management" back on in the Windows 10 advanced power options settings. craigr Quote Link to comment
gray squirrel Posted December 10, 2020 Share Posted December 10, 2020 As an alternative... I don’t sleep my VM I shut them down. I then use the below guide to send a remote WOL request. I have shortcuts on my phone that I can ask Siri to activate. works well and the VM is booted before I have had chance to sit down at my gaming chair! Quote Link to comment
methanoid Posted December 17, 2020 Share Posted December 17, 2020 Nice info OP. Not running unRAID right now (various reasons) but if you sleep your unRAID server, what happens to VMs that may be running or sleeping when you Resume your unRAID server? I know, not 100% related but it is related sorta.... Quote Link to comment
craigr Posted December 21, 2020 Author Share Posted December 21, 2020 On 12/17/2020 at 5:09 AM, methanoid said: Nice info OP. Not running unRAID right now (various reasons) but if you sleep your unRAID server, what happens to VMs that may be running or sleeping when you Resume your unRAID server? I know, not 100% related but it is related sorta.... I don’t ever sleep the server, only the Windows 10 VM running on it. craigr Quote Link to comment
methanoid Posted December 21, 2020 Share Posted December 21, 2020 Bit what happens to live VMs of you (or someone) does? I can't test cos I don't.have UnRAID anymoreSent from my SM-G970F using Tapatalk Quote Link to comment
bjornatic Posted February 5, 2021 Share Posted February 5, 2021 (edited) I can answer this as I use a Windows 10 and BigSur VM : I can put to sleep the Windows Vm and put to sleep Unraid with no problem : I wake Unraid, then the W10 wm, and all work fine. Everytime. All bueno. For my Bigsur VM (and for Catalina before it), it's another story and it's the ONLY thing that I can't solve on my Unraid system (well beside network troubles under BigSur..). Meaning the same operation as with the W10 VM works... sometimes. And I can't figure out why as the problem is not happening everytime. But that would be the subject of another thread 🤫 Edited February 5, 2021 by bjornatic Quote Link to comment
methanoid Posted February 5, 2021 Share Posted February 5, 2021 1 minute ago, bjornatic said: I can answer this as I use a Windows 10 and BigSur VM : I can put to sleep the Windows Vm and put to sleep Unraid with no problem : I wake Unraid, then the W10 wm, and all work fine. Everytime. All bueno. For my Bigsur VM (and for Catalina before it), it's another story and it's the ONLY thing that I can't solve on my Unraid system (well beside network troubles under BigSur..). Meaning the same operation as with the W10 VM works... sometimes. And I can't figure out why as the problem is not happening everytime. But that would be the subject of another thread 🤫 So Sleeping unRAID does NOT sleep the VM first ? Seems to me that would be cleanest way to do it.... Quote Link to comment
bjornatic Posted February 5, 2021 Share Posted February 5, 2021 (edited) I do not now. I think it would be possible by adding the correct command in the sleep plugin (as sleep is not officially supported by Unraid). And it may be a clean way, but not the logical way in my opinion. The VM has to decide by itself (or by manual command) to be put to sleep. And THEN, the Unraid server, "seeing" that everyone is sleeping, puts himself to sleep. And that's how I have it working. The problem I have is on wake up ^^ (for MacOS only, though). EDIT : and by "sleep" I mean hibernate... just to be clear. And It this state I can even restart the server and the W10 VM will resume OK. EDIT again : I looked around and noticed the option "Enable Virtual BMC :" in the VM manager. And I think that could enable what you suggested. Edited February 5, 2021 by bjornatic Quote Link to comment
Linguafoeda Posted October 10, 2021 Share Posted October 10, 2021 How do you enable a Windows VM to go to sleep if it's not being used? I don't want my Windows VM hammering my CPU / HDDs if not being used and i forgot to manually shut down the VM. Is there a way to do this? Quote Link to comment
craigr Posted January 3, 2023 Author Share Posted January 3, 2023 On 10/10/2021 at 1:37 AM, Linguafoeda said: How do you enable a Windows VM to go to sleep if it's not being used? I don't want my Windows VM hammering my CPU / HDDs if not being used and i forgot to manually shut down the VM. Is there a way to do this? All you need do is sleep it like a regular Windows install. Just go into Windows power settings and set the number of minutes until sleep. Quote Link to comment
craigr Posted January 3, 2023 Author Share Posted January 3, 2023 I also usually just do shutdown > sleep when I walk away if I know I'm not coming back. Quote Link to comment
Linguafoeda Posted December 6, 2023 Share Posted December 6, 2023 (edited) On 1/3/2023 at 3:20 PM, craigr said: All you need do is sleep it like a regular Windows install. Just go into Windows power settings and set the number of minutes until sleep. I don't have any of these options - just "sign out/shutdown/restart" in the ctrl+X menu. There is no option in settings either - just an option to "turn off display". I'm running Windows 11 Pro 23H2. I also am unable to hibernate the VM itself - it gives error "Domain 'Windows' could not be suspended. internal unable to execute QEMU agent command 'guest-suspend-disk': Guest agent command failed, error was 'suspend-to-disk not supported by OS'." Edited December 6, 2023 by Linguafoeda Quote Link to comment
SimonF Posted December 6, 2023 Share Posted December 6, 2023 4 hours ago, Linguafoeda said: I don't have any of these options - just "sign out/shutdown/restart" in the ctrl+X menu. There is no option in settings either - just an option to "turn off display". I'm running Windows 11 Pro 23H2. I also am unable to hibernate the VM itself - it gives error "Domain 'Windows' could not be suspended. internal unable to execute QEMU agent command 'guest-suspend-disk': Guest agent command failed, error was 'suspend-to-disk not supported by OS'." Have you installed the guest agent in the VM? It is on the Virtio CD. Quote Link to comment
Linguafoeda Posted December 6, 2023 Share Posted December 6, 2023 40 minutes ago, SimonF said: Have you installed the guest agent in the VM? It is on the Virtio CD. Do you have step by step instructuons on how to install? I went into VM settings and clicked download on the latest drivers which saved to my ISO share folder but not sure what to do after that Quote Link to comment
SimonF Posted December 6, 2023 Share Posted December 6, 2023 Add the CD image to the VM either via the template or via the CDs if one is shown. You can eject and insert. Then in the VM browse to the CD and run guest tools. And they run Quote Link to comment
Linguafoeda Posted December 7, 2023 Share Posted December 7, 2023 @SimonF i installed the virtio-win-guest-tools but am still missing sleep option. I just opened up the ISO from the shared cache drive which mounted it locally within windows and installed all the driver options available (0.1.240). I restarted and also tried once more to install and hit the "repair" option for good measure. Quote Link to comment
SimonF Posted December 7, 2023 Share Posted December 7, 2023 5 hours ago, Linguafoeda said: @SimonF i installed the virtio-win-guest-tools but am still missing sleep option. I just opened up the ISO from the shared cache drive which mounted it locally within windows and installed all the driver options available (0.1.240). I restarted and also tried once more to install and hit the "repair" option for good measure. Not sure if you need it but I have seen posts stating having hyper-v enabled may cause this issue. Try with hyper-v set to No Quote Link to comment
Linguafoeda Posted December 7, 2023 Share Posted December 7, 2023 2 hours ago, SimonF said: Not sure if you need it but I have seen posts stating having hyper-v enabled may cause this issue. Try with hyper-v set to No Wouldn't this hurt vm performance which is what I'm trying to optimize (faster VM, less CPU usage, ability to save power/free up CPU & RAM by sleeping VM if idling for more than 30-60mins etc) Or am I confusing what hyper-V does and how to interacts with the changes I did to my VM XML from m00nman's optimization guide Quote Link to comment
Linguafoeda Posted February 14 Share Posted February 14 (edited) On 12/7/2023 at 4:22 AM, Linguafoeda said: Wouldn't this hurt vm performance which is what I'm trying to optimize (faster VM, less CPU usage, ability to save power/free up CPU & RAM by sleeping VM if idling for more than 30-60mins etc) Or am I confusing what hyper-V does and how to interacts with the changes I did to my VM XML from m00nman's optimization guide bump - curious on if disabling hyper-v altering performance. i had finally tuned my windows VM for high performance (especially switching to microsoft RDP for access, installing intel-gvt for virtualized iGPU acceleration and following m00nman's perf thread. I did make a bunch of his XML edits which reference hyper-V so i don't want to then toggle the hyper-v in the non-XML edit of the VM which may cause issues with what i setup via @m00nman Edited February 14 by Linguafoeda Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.