In the age of remote work and online collaboration, having a machine that can be controlled and accessed from anywhere is becoming increasingly common. But what happens when you need to choose an operating system at boot time, but aren't physically near your machine? [Dakhnod]'s ingenious solution addresses this problem by combining GRUB, Wake-on-LAN (WOL), and a lightweight ESP8266 running a simple HTTP server.
The setup is based on modifying GRUB to fetch its boot configuration over HTTP. The ESP8266 (or any low-power device) serves up a config file defining which operating system should launch. At its core, this hack requires a custom script that tells GRUB to source an external config.
Since GRUB itself makes the HTTP request, the system needs a running web server. This could be a Raspberry Pi, another machine, or even the ESP itself. From there, a WOL-enabled ESP button can wake up the PC and set the boot parameters remotely. The beauty of this setup lies in its flexibility.
The security aspect is crucial here. An open, unauthenticated web server dishing out GRUB configs is risky, but within a controlled LAN or a VLAN-segmented environment, it's an intriguing option. Automation possibilities are everywhere – imagine remotely booting test rigs, toggling between OS environments for debugging, or even setting up kiosk machines that reconfigure themselves based on external triggers.
For those looking to take this hack further, using a config file instead of source allows for more dynamic menu entries, although it won't persist environment variables. You could even combine it with another Raspberry Pi hack to control the uptime of the HTTP server.
The balance between convenience and security is ultimately yours to strike. If you've got your own wild GRUB customisation, we'd love to hear about it!