💾 Archived View for shit.cx › tech › devenv › 2021-04-04-wake-on-lan captured on 2022-04-29 at 11:20:51. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-11-30)
-=-=-=-=-=-=-
. * ⠈ + ⠈ + ──╕ ○ . ⠈ ⠐ ● . ╒═╕╞═╕ ╕ ╪═ * . ╘═╕│ │ │ │ .cx + . ....╘═╛╘ ╘ ╘ ╘═ ....: ⠐ . . * ⠐ .
2021-04-04T21:23
Around 20 years ago when I first learnt about Wake on LAN (WoL) I remember unsuccessfully trying to set it up. Until a couple of days ago I've never revisited that problem.
I still don't understand WoL well, but it appears to require a few things to all work before it will function:
Configuring the BIOS was simple, but I didn't realise at first that I needed to do anything more. ethtool showed that the interface was already configured for WoL. It wasn't until I reset it with `sudo ethtool -s <interface> wol g` that it worked, and only for one boot. I then battled systemd to get the setting to persist across boots. I soon discovered that the example using `/etc/network/interfaces.d` from the Debian Wiki¹ worked fine:
auto eth0 iface eth0 inet dhcp ethernet-wol g
I can now remotely turn on my machine using `wakeonlan` or `etherwake`. I'm not yet sure if I'll actually use this beyond lazily avoiding a walk or a reach to the power button. Depending on how reliable it is, it may allow me to keep the machine under the house where it's cooler in summer.
The Magic Packets are also routable across the internet. Once I start going back to the office, it may reduce one of the risks of relying on machine that's at home.
At the back of my mind, I've been thinking about putting a Raspberry Pi between the machines power and reset switches. It might also connect to the serial port for a console. It will be basically a hand-rolled Lights-Out³. But I have my doubts whether this project will ever bubble to the top of my projects list. If the machine is unreliable I'll probably make it reliable before I try to reduce the impact its failures. It's one thing to spend an hour setting up WoL or a serial console, but building a Lights-Off system feels like a substantially bigger project.
A quick search shows how someone built something similar.⁴ They went all out and captured the VGA output and sent keyboard and mouse input. This gave them immediate access to the system, including to the BIOS. Using serial instead would make the problem a lot easier, but I wouldn't get a view of the system until later in the boot process, but could still blindly reboot it at any stage. But it's a fairly elaborate solution to avoid asking someone at home to press a button for me.
⁴ Pilo: Raspberry Pi-Powered Lights-Out Remote Server Management for $60 or less
---
The content for this site is CC-BY-SA-4.0.