User avatar
NickT
Posts: 276
Joined: Mon May 21, 2012 10:43 am
Location: UK

PXE booting a Pi 3 from a Pi configured as a PXE server?

Mon Dec 19, 2016 11:59 am

My understanding is that the Pi 3 will offer network booting, which I think is synonymous with PXE.

Background:
A while ago I made my first version Pi act as a PXE server. I only have one machine (an ancient laptop) which can network boot and I can see that my Pi will offer it the options that I programmed in to its SD card (Ubuntu, Debian, Gparted ).

My question is:
Can I use that Pi to offer an option suitable for the Pi 3 to boot from?

All advice gratefully received. I don't own a Pi 3 at the moment but it may be something of interest in the new year.

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: PXE booting a Pi 3 from a Pi configured as a PXE server?

Mon Dec 19, 2016 12:15 pm

Yes. That's the way I demo'd it.

Get your RPi 3B booting from a USB stick first following the official instructions for that.

Poweroff. Pull the USB stick and insert that into RPi2B.

Install all the stuff from https://help.ubuntu.com/community/SettingUpNFSHowTo to get an NFS server working. Install dnsmasq.

mkdir /tftp
sudo mount /dev/sda2 /tftp
sudo mount /dev/sda1 /tftp/boot


Add /etc/exports

Code: Select all

/tftp *(rw,sync,no_subtree_check,no_root_squash)
Update /etc/fstab on the 2B with

Code: Select all

/dev/sda2 /tftp ext4 defaults,noatime 0 1
/dev/sda1 /tftp/boot vfat defaults 0 0
Run dnsmasq with

Code: Select all

port=0
dhcp-range=10.1.2.10,10.1.2.40,300h
log-dhcp
enable-tftp
tftp-root=/tftp/boot
pxe-service=0,"Raspberry Pi Boot"
Update /etc/dhcpcd.conf on the 2B with

Code: Select all

interface eth0
static ip_address=10.1.2.99/24
Update /tftp/boot/cmdline.txt with

Code: Select all

dwc_otg.lpm_enable=0 console=tty1 root=/dev/nfs nfsroot=10.1.2.99:/tftp elevator=deadline rootwait quiet splash plymouth.ignore-serial-consoles ip=dhcp
Reboot the RPi2B.

Connect the two Raspberries with a straight 568A to 568A CAT5 cable (or with a dedicated ethernet switch).

Boot the RPI3B and be amazed.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
NickT
Posts: 276
Joined: Mon May 21, 2012 10:43 am
Location: UK

Re: PXE booting a Pi 3 from a Pi configured as a PXE server?

Mon Dec 19, 2016 12:22 pm

Thanks Dougie, I'll read that in detail later. Just one quick question : Will it work with my very first version Pi as the PXE server? That's the only Pi that I have permanently on with an Ethernet connection, as it serves as my print server at the moment. (It works OK to serve up Ubuntu/Debian options at the moment.)

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: PXE booting a Pi 3 from a Pi configured as a PXE server?

Mon Dec 19, 2016 12:54 pm

The PXE server can be anything (PC, laptop, Raspberry, Arduino, OpenWRT AP) with an ethernet interface running any flavour of Linux or roll-your-own operating system (that can run dnsmasq (for the PXE piece) and an nfs server (for the root filesystem)).

Obviously not an A, A+ or Zero (without extra hardware).
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “General discussion”