Unraid Power Management: Lan Wake-Up And Sleep Guide

does unraid sleep and wake up on lan

Unraid server users can set up their devices to wake up from a shutdown or sleep state by sending a 'magic packet' over their local area network (LAN). This can be done by using another device on the same network or even a smartphone with the right software. This process is known as Wake on LAN (WoL) and requires users to enable specific settings in the Basic Input/Output System (BIOS) and adjust their network interface controller (NIC) to support WoL. Users have reported issues with their systems misbehaving after the initial sleep state, so it is recommended to test the sleep and wake-up functions before setting up WoL.

Characteristics Values
Can Unraid sleep and wake up on LAN? Yes, the Unraid server can be set up to wake up from a shutdown or sleep state by sending a magic packet over the network.
How to set up Wake-on-LAN Enable the Wake on LAN setting in BIOS, connect the server to a power outlet and local area network (LAN) via a network cable, and use the web terminal in the WebGUI or SSH into the server.
Magic Packet Tools MiniWOL, an OS-agnostic app that can run on MacOS, Linux, and Windows.
Sleep State S3 sleep state.
Sleep Script The sleep script can be generated or downloaded from the Unraid 'Devices' page, where you can make a list of hard drives in the system.
Wake-up Script The Wakeup.bat batch file can be generated or downloaded.

shunsleep

Enabling 'Resume by LAN' in BIOS

To enable Resume by LAN in BIOS, you must first ensure that your network interface controller (NIC) supports Wake-on-LAN (WoL). Then, follow these steps:

  • Restart your computer and enter the BIOS setup utility. Typically, you can access this utility by pressing F2, F10, F12, or Del.
  • Once in the BIOS setup utility, navigate to the Power Management or Integrated Peripherals menu. The specific menu name may vary depending on your BIOS version.
  • Within the Power Management or Integrated Peripherals menu, locate the Wake-on-LAN or Power Management settings.
  • Enable the Wake-on-LAN or Power Management settings.
  • Save and exit the BIOS setup utility.

Additionally, you can enable Resume PCIe BIOS Immediate PC Restart. This feature allows your computer to resume operations immediately from a shutdown or hibernate state. To enable this, follow these steps:

  • Restart your computer and enter the BIOS setup utility, as described in the previous steps.
  • Navigate to the Power Management or Advanced menu.
  • Locate the Resume PCIe or APM settings and enable them.
  • Save and exit the BIOS setup utility.

It is important to note that to use Wake-on-LAN with Resume PCIe, your network adapter must support both features.

After enabling Resume by LAN in BIOS, you can further configure your Unraid server for Wake-on-LAN. This includes confirming BIOS settings, generating a Wakeup.bat batch file, and spinning down drives.

Fitbit's Power to Wake Heavy Sleepers

You may want to see also

shunsleep

Sending a 'magic packet' to wake up the Unraid server

To wake up an Unraid server from a shutdown or sleep state, you can send a magic packet over the network. A magic packet is a special data packet that contains the target computer's media access control (MAC) address and network broadcast address along with the Wake-on-LAN (WoL) configurations.

  • Ensure that your Unraid server is connected to a power outlet and your local area network (LAN) via a network cable.
  • Verify that your network interface controller (NIC) supports WoL.
  • Check that your chipset and BIOS have a setting for WoL, and enable it. The BIOS option varies depending on the system, but it is usually located in a power management menu.
  • On the Unraid 'Devices' page, make a note of the hard drive references in your system. This is to build a list of hard drives for use in the sleep script.
  • Generate a sleep script or download one provided by the community.
  • Save the sleep script onto a flash drive in a specified location. Ensure that you do not create another "boot" directory to avoid losing your configuration.
  • Download wolcmd.exe and unpack it to a folder of your choice.
  • Open the Windows command line and navigate to the folder where you extracted the executable.
  • Type the following command: wolcmd.exe 255.255.255.255. Here, ether> is the MAC address of the computer you want to wake up, and ip-dest> is the IPv4 address of the machine.
  • Alternatively, you can use an OS-agnostic app like MiniWOL, which can run on MacOS, Linux, and Windows.

It is important to note that some people have reported issues with their systems misbehaving on the second or later sleep attempts. Therefore, it is recommended to test the sleep and wake-up process multiple times to ensure everything is functioning correctly.

shunsleep

Using a smartphone to wake up the server

To wake up an Unraid server from a shutdown or sleep state, you can send a "magic packet" over the network. A magic packet is a special data packet that contains the target computer's media access control (MAC) address and network broadcast address, along with the Wake-on-LAN (WOL) configurations.

To set up Wake-on-LAN on an Unraid server, the server must be connected to a power outlet and to a local area network (LAN) via a network cable. You can then trigger a sleep state by using the web terminal in the WebGUI or SSH into the server and typing specific commands.

There are several ways to wake up the server using a smartphone. One way is to use an app like PCAutoWaker, which automatically wakes up your PC when your phone connects to your home Wi-Fi network using Wake-on-LAN. Another way is to use a standalone WOL app, which can send magic packets to wake up the server. Additionally, you can use a NodeRED server hosted on a Raspberry Pi to issue Wake-on-LAN packets and relay information between Android devices and smart assistants.

  • Enable the "Resume by LAN" option in the BIOS settings of the Unraid server.
  • Boot the Unraid server and use the Terminal on the WebUI or SSH to confirm that the "Wake-on" setting includes 'g', which enables Wake on Magic Packet.
  • Download wolcmd.exe and unpack it to a folder.
  • Open the Windows command line and navigate to the folder containing wolcmd.exe.
  • Type the following command: "wolcmd.exe 255.255.255.255", where is the MAC address of the Unraid server, and is the IPv4 address of the machine.
  • Generate a Wakeup.bat batch file or download a pre-made one and place it on your desktop for easy access.
  • Open the batch file and enter the MAC address of your Unraid server.
  • Test the sleep and wake-up functions to ensure they are working correctly.

shunsleep

Using a Raspberry Pi to send 'magic packets'

Unraid servers can be set up to wake up from a shutdown or sleep state by sending a magic packet over the network. This can be done from any computer or smartphone with the right software. The magic packet is a special data packet that contains the target computer's media access control (MAC) address and network broadcast address along with the Wake-on-LAN (WOL) configurations.

To use a Raspberry Pi to send magic packets, you can follow these steps:

  • Set up your Raspberry Pi: Download the operating system image, such as Raspbian Jessie lite, and use software like Balena Etcher to flash the image onto a microSD card. The Raspberry Pi will run off this card with the operating system on it.
  • Install a Wake-on-LAN package: You can use a free piece of software called Etherwake, which allows your Raspberry Pi to act as a Wake-on-LAN server and send packets to other devices.
  • Configure your target device: Set up your other devices so they can wake when sent a Wake-on-LAN packet from your Raspberry Pi. This is typically done through the device's BIOS, which will allow the device to boot even if it has been powered off.
  • Obtain the MAC address of the target device: You will need to know the MAC address of the device you want to wake up. This can often be found in the router's device list or by checking the details of the connection on the device.
  • Send the magic packet: Use the Etherwake software on your Raspberry Pi to send the magic packet to the target device's MAC address. You can do this by writing a short script or using a command-line tool.

By following these steps, you can use a Raspberry Pi to send magic packets and wake up devices remotely, even if they are in a sleep state or powered off.

shunsleep

Saving the sleep script onto a flash drive

  • Generate the Sleep Script: Before saving, you need to create the sleep script. This can be done manually or by downloading a pre-made script provided by some Unraid users. The script should be tailored to your specific system, particularly the number and type of drives in your setup. For example, if you have two SATA drives, your drive references might be "sda" and "sdb". It's important to note that the drive list can change when upgrading Unraid or modifying hardware, so ensure your script reflects the current configuration.
  • Choose a Title and File Location: When saving the sleep script onto the flash drive, choose an appropriate title and file location. For instance, you can name the script "s3.sh" and save it in the "/boot/custom/bin" directory. It's crucial not to create another "boot" directory within the flash drive's root directory, as this will cause Unraid to lose track of your configuration.
  • Consider the "boot" Directory: Remember that "boot" is typically the name of the root directory on your flash device. Therefore, avoid creating a new "boot" directory when saving your script. Creating an additional "boot" directory can result in Unraid losing track of your config directory and your entire configuration unless it has been previously backed up.
  • Adjust File Directory Structure: Depending on where you saved your sleep script (s3.sh), you may need to adjust the file directory structure accordingly. Ensure that the path to your script is correct and accessible.
  • Consistency and Testing: It's important to note that some users have reported issues with their systems after the initial sleep and wake-up cycle. Therefore, it's recommended to test the sleep and wake-up process multiple times to ensure everything functions correctly. Inconsistencies in network speeds after sleep, for instance, may indicate a Linux driver issue.

By following these steps, you can effectively save the sleep script onto a flash drive, enabling your Unraid server to enter a sleep state and be awakened remotely using Wake on LAN (WOL) functionality.

Frequently asked questions

You can set up your Unraid server to wake up from a shutdown or sleep state by sending a magic packet over the network. This can be done from any computer on the same network or even from a smartphone with the right software. To do this, you will need to:

- Connect your Unraid server to a power outlet and your local area network (LAN) via a network cable.

- Use the web terminal in the WebGUI or SSH into the server.

- Type ifconfig and note the IP address and MAC address of the network interface card in use.

- Type ethtool -s eth0 wol g.

- Type echo -n mem > /sys/power/state to trigger sleep mode.

A magic packet is a special data packet that contains the target computer's media access control (MAC) address and network broadcast address along with the WOL configurations.

You can generate a magic packet using tools such as wolcmd.exe or MiniWOL, which can run on Windows, MacOS, or Linux.

Some people have reported that their system misbehaves on the second or later sleep. If this happens, test the sleep and wake-up functions to ensure everything is correct.

Written by
Reviewed by
Share this post
Print
Did this article help you?

Leave a comment