RaspberryPi4 PXE Boot


Is it possible to boot and run BalenaOS on Raspberry Pi 4 completely from network without SD card.

I would be grateful if anyone with experience in this area could share their knowledge and provide guidance on the steps involved. Thank you in advance for your help.

HI there,

I do in fact beleive this should be possible.

Firstly, you’ll have to change the Pi 4’s boot order in the EEPROM: Raspberry Pi Documentation - Remote access

Then, you can look at this project: GitHub - jakogut/balena-netboot-provisioner: Netboot provisioning server for balena devices which one of our team made. Its original purpose was to network boot a device with an installer, which would then write the balena OS image to the disk of the device. However I’m sure if you look inside this project, you could see if you could simply boot from the network and not install anything to an SD card.

The author of this project may see this and comment later too.

Thank You for replay!

The main purpose of this task is to run BalenaOs on Pi 4 completly without SD card by hosting tftp and nsf shares from linux server.

I was able to run Raspberry Pi OS completely from network and looking for same solution for BalenaOs.

It’s not clear for me how system mount partitions.

As I understand I just need to clone existing partition from SD card to network shares (boot to tftp, and 5 other to nfs shares), and change BalenaOs fstab to mount them during boot.

After 2 weeks no success…

Did this server and the configuration mentioned in the README, not help as to how the system works: GitHub - jakogut/balena-netboot-provisioner: Netboot provisioning server for balena devices
Are you using your own server implementation?

Hi there,

What OS and docker version has this script been tested on?


I’m the author of the above project. You’ll want to network boot your Pi by setting up a DHCP and TFTP server along with the firmware necessary to boot the Pi, as well as the kernel to run balenaOS. The netboot provisioner project can serve as a reference, but you’ll need to customize this to work as you wish. For reference, here’s the official documentation from the Pi Foundation about how to network boot the Pi: Raspberry Pi Documentation - Raspberry Pi hardware

After the kernel is loading over the network, you’ll want to mount your root filesystem over NBD or NFS. Previously, I’ve chosen NBD, and I have an example prepared you can use as a reference: initramfs-toolkit/run.sh at master · balena-io-experimental/initramfs-toolkit · GitHub

This script will add a hook to the initramfs to setup the network block device (NBD) and tunnel I/O requests over the network. You’ll want to configure your bootloader to load the supplemental initramfs containing the supporting files and configuration for network booting.

Let me know if you have any more questions.

Thank You for explanation!

Actually the last part is where I stuck. How to mount partitions from from network device.

Usually in linux I have /etc/fstb file where I can point each partition to corresponding network device.

I have no requirement to full install from clean balena image or cloud. I can install belena on sd card and clone each partition to network share.
The process is similar as for RaspberryPi 4 pxe boot.
After that I need to modify balena to mount shares from network at boot time.

For NBD mounts, I used the Diskless system Arch Linux wiki page as a reference. Basically, you’ll want your balenaOS image stored on a machine on the same network, and you’ll want to setup an NBD server with that image. The network booting client will load the firmware, bootloader, bootloader configuration, and kernel over the network, usually using TFTP and/or HTTP. Once the kernel starts, it will mount the NBD device in the initramfs using configuration present on the kernel command line.

Hi, I’m currently trying the same thing, but it’s slow going at best.
Did you ever get network boots to work?