Search code examples
installationraspberry-piwake-on-lan

Wake-on LAN and send OS to Raspberry via network?


Maybe this is a stupid idea, but I wonder whether it's possible (and maybe it's even the wrong place to ask, so please correct me if I'm wrong).

I was wondering whether the following is possible:

  • Take a powered-off Raspberry Pi.
  • Connect it to a network switch.

Then, from another computer:

  • Send a signal to the switch (and hence to the Pi) to wake the Pi up.
  • Transfer the operating system to the Pi via the network, so that the Pi boots to whatever you send to it.
  • Transfer the initial setup of files & co. to the Pi to setup the environment.

Is this doable?

My idea was to use SD-card-less Pis and equip them purely via the network. This would make managing a lots of Pis from a central location very easy, and you could control the setup from a central point.

What do you think?

If it's not possible: What may come close to it? Can you run Vagrant on the Pi, e.g.?


Solution

  • While this probably doesn't belong on SO (There's an SE site just for Raspberry Pi), I'll answer it here.

    From my understanding, the burned-in bootloader on the Pi is hardwired to pull files off of the SD card. And the Pi also has nothing like PXE, which is what enables pulling down an OS image from the network on other platforms.

    Also, the Pi has no real "off" state. If it's plugged into power, it's running. You might be able to do something with PoE, but I'm unsure if there are any you could network control. You might be able to do something with an Arduino hooked to ethernet switching the 5V supply to the pi, but that seems overkill.

    So, there's no way to boot the Pi without the SD card, however, you could put a linux kernel on it, with an initrd (if the Pi kernel supports it, otherwise just a basic userland) that connects to the real file system root somewhere else. You might be able to do some kexec shenanigans if you want the kernel to be on NFS, too (also not sure).

    In short, what you're looking to do isn't going to be possible without some major compromises.