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.

Automatic shutdown/restart unraid when VM is shutdown/restart

Featured Replies

Hi everyone,

 

does anyone know if there is a way to automatic shutdown or reboot the unraid server whenever you power off or reboot, from within, a specific VM?

Can I edit the XML or maybe write a script..?

Sorry if this has been answered before, i could not find anything about it.

 

Thank you!

 

  • Community Expert

There is a hooks process within QEMU that can be used. Currently there is only one within unraid and there isn't an easy way to add a VM specific script.

 

File is in /etc/libvirt/hooks and its called qemu.

 

For my plugin users need to Manually update the file.

 

if ($argv[2] == 'prepare' || $argv[2] == 'stopped'){
    shell_exec("/usr/local/emhttp/plugins/unraid.usbip-gui/scripts/rc.unraid.usbip-gui vm_action '{$argv[1]}' {$argv[2]} {$argv[3]} {$argv[4]}  >/dev/null 2>&1 & disown") ;
}

 

https://libvirt.org/hooks.html

  • Author

Thank you Simon,

 

actually it doesn't need to be VM specific since I only use one VM, and the idea is just that if I shut down that VM the whole system shuts down.

 

Right now i cannot test it, but you are saying that if I install your plugin (and update the quemu) there's a way i can do that from gui?

Sorry for the silly question but i'm pretty new to unraid

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.