Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

This is an easy way to sleep and wake Windows VM's from sleep:

Featured Replies

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 by craigr

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?

  • Author
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

  • Author

Also, don't forget to turn "Link State Power Management" back on in the Windows 10 advanced power options settings.

 

craigr

  • 3 months later...

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!

 

 

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.... 

  • Author
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

Bit what happens to live VMs of you (or someone) does? I can't test cos I don't.have UnRAID anymore

Sent from my SM-G970F using Tapatalk

  • 1 month later...

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 by bjornatic

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....

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 by bjornatic

  • 8 months later...

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?

  • 1 year later...
  • Author
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.

  • Author

I also usually just do shutdown > sleep when I walk away if I know I'm not coming back.

  • 11 months later...
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 by Linguafoeda

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.

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

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.

 

image.png

 

And they run 

image.png

@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.

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

 

image.png

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

 

image.png

 

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

  • 2 months later...
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 by Linguafoeda

  • 6 months later...

FYI for anyone trying WOL for VMs, now there is a new plugin [PLUGIN] WOL for Services - Plugin Support - Unraid by SimonF, still in BETA.

This plugin (besides VM) can also do docker and services start/stop. And builds upon and expands the existing plugin called virtwold. I have not tested it.

 

I believe it deprecates the really old Wake on Lan for Virtual Machines for 6.1+ - Plugin Support - Unraid that stopped working properly end of 2023 with Unraid 6.12.4 , for which users where creating new workarounds and scripts. I have not used these.

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.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.