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.

Start/stop VMs on schedule

Featured Replies

How can I set up my VMS so that I can have them all go to sleep at say 10pm at night and wake up at 8am? My disks could spin down then. I don't really want to shut down/start up again, a sleep would be fine. I am guessing some sort of libvirt command line on a schedule? Actually I wonder if the hard part is the scheduling :) not familiar with all the flavours of unix to know how to schedule scripts at specific times in unRAID...

3 hours ago, planetwilson said:

Actually I wonder if the hard part is the scheduling :) not familiar with all the flavours of unix to know how to schedule scripts at specific times in unRAID...

Can't help you with the actual script though...

  • 1 year later...
On 5/1/2017 at 4:46 PM, planetwilson said:

How can I set up my VMS so that I can have them all go to sleep at say 10pm at night and wake up at 8am? My disks could spin down then. I don't really want to shut down/start up again, a sleep would be fine. I am guessing some sort of libvirt command line on a schedule? Actually I wonder if the hard part is the scheduling :) not familiar with all the flavours of unix to know how to schedule scripts at specific times in unRAID...

did you ever come up with a solution? or did you just use a CRON job? 

  • Author

No I didn't but might have another go now you've reminded me. Ideally there would be something I could do for OSX but I think that would need to be a sleep from inside the VM with restore from outside

15 hours ago, planetwilson said:

No I didn't but might have another go now you've reminded me. Ideally there would be something I could do for OSX but I think that would need to be a sleep from inside the VM with restore from outside

Yeah, you can't sleep a Mac VM from the unraid side. In fact, I don't think you can use the Mac OS sleep function from within the VM either, from memory I was never able to wake it up again when I played around with that.

 

For my Mac VM I set a scheduled shutdown from the Mac System Preferences/Energy Saver/Schedule. Then I start it on-demand with the WOL plugin and a WOL app on my phone. But I'm sure you could also schedule a start via User Scripts.

The built-in Mac scheduler has an option for scheduling starts as well, but I doubt it would work in a VM.

 

 

Screen Shot 2018-12-10 at 10.35.11 pm.png

Just realised I have a need to start the VM on a schedule too. This super simple script will do the trick, scheduled from the Users Scripts plugin with a custom cron.

#!/bin/bash
virsh start "<name-of-VM>"

Replace <name-of-VM> with the VM name as shown in the unraid UI

  • Author

Yes I'll be doing similar but I think I'll do virsh stop and virsh resume to just have them sleep/wake up rather than go through a reboot cycle as I can't guarrantee clean shutdown depending on what is running

Archived

This topic is now archived and is closed to further replies.

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.