The Raspberry Pi PiServer tool
As Simon mentioned in his recent blog post about Raspbian Stretch, we have developed a new piece of software called PiServer. Use this tool to easily set up a network of client Raspberry Pis connected to a single x86-based server via Ethernet. With PiServer, you don’t need SD cards, you can control all clients via the server, and you can add and configure user accounts — it’s ideal for the classroom, your home, or an industrial setting.
Client? Server?
Before I go into more detail, let me quickly explain some terms.
- Server — the server is the computer that provides the file system, boot files, and password authentication to the client(s)
- Client — a client is a computer that retrieves boot files from the server over the network, and then uses a file system the server has shared. More than one client can connect to a server, but all clients use the same file system.
- User – a user is a username/password combination that allows someone to log into a client to access the file system on the server. Any user can log into any client with their credentials, and will always see the same server and share the same file system. Users do not have sudo capability on a client, meaning they cannot make significant changes to the file system and software.
I see no SD cards
Last year we described how the Raspberry Pi 3 Model B can be booted without an SD card over an Ethernet network from another computer (the server). This is called network booting or PXE (pronounced ‘pixie’) booting.
Why would you want to do this?
- A client computer (the Raspberry Pi) doesn’t need any permanent storage (an SD card) to boot.
- You can network a large number of clients to one server, and all clients are exactly the same. If you log into one of the clients, you will see the same file system as if you logged into any other client.
- The server can be run on an x86 system, which means you get to take advantage of the performance, network, and disk speed on the server.
Sounds great, right? Of course, for the less technical, creating such a network is very difficult. For example, there’s setting up all the required DHCP and TFTP servers, and making sure they behave nicely with the rest of the network. If you get this wrong, you can break your entire network.
PiServer to the rescue
To make network booting easy, I thought it would be nice to develop an application which did everything for you. Let me introduce: PiServer!
PiServer has the following functionalities:
- It automatically detects Raspberry Pis trying to network boot, so you don’t have to work out their Ethernet addresses.
- It sets up a DHCP server — the thing inside the router that gives all network devices an IP address — either in proxy mode or in full IP mode. No matter the mode, the DHCP server will only reply to the Raspberry Pis you have specified, which is important for network safety.
- It creates usernames and passwords for the server. This is great for a classroom full of Pis: just set up all the users beforehand, and everyone gets to log in with their passwords and keep all their work in a central place. Moreover, users cannot change the software, so educators have control over which programs their learners can use.
- It uses a slightly altered Raspbian build which allows separation of temporary spaces, doesn’t have the default ‘pi’ user, and has LDAP enabled for log-in.
What can I do with PiServer?
Serve a whole classroom of Pis
In a classroom, PiServer allows all files for lessons or projects to be stored on a central x86-based computer. Each user can have their own account, and any files they create are also stored on the server. Moreover, the networked Pis doesn’t need to be connected to the internet. The teacher has centralised control over all Pis, and all Pis are user-agnostic, meaning there’s no need to match a person with a computer or an SD card.
Build a home server
PiServer could be used in the home to serve file systems for all Raspberry Pis around the house — either a single common Raspbian file system for all Pis or a different operating system for each. Hopefully, our extensive OS suppliers will provide suitable build files in future.
Use it as a controller for networked Pis
In an industrial scenario, it is possible to use PiServer to develop a network of Raspberry Pis (maybe even using Power over Ethernet (PoE)) such that the control software for each Pi is stored remotely on a server. This enables easy remote control and provisioning of the Pis from a central repository.
How to use PiServer
The client machines
So that you can use a Pi as a client, you need to enable network booting on it. Power it up using an SD card with a Raspbian Lite image, and open a terminal window. Type in
echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt
and press Return. This adds the line program_usb_boot_mode=1
to the end of the config.txt
file in /boot
. Now power the Pi down and remove the SD card. The next time you connect the Pi to a power source, you will be able to network boot it.
The server machine
As a server, you will need an x86 computer on which you can install x86 Debian Stretch. Refer to Simon’s blog post for additional information on this. It is possible to use a Raspberry Pi to serve to the client Pis, but the file system will be slower, especially at boot time.
Make sure your server has a good amount of disk space available for the file system — in general, we recommend at least 16Gb SD cards for Raspberry Pis. The whole client file system is stored locally on the server, so the disk space requirement is fairly significant.
Next, start PiServer by clicking on the start icon and then clicking Preferences > PiServer. This will open a graphical user interface — the wizard — that will walk you through setting up your network. Skip the introduction screen, and you should see a screen looking like this:
If you’ve enabled network booting on the client Pis and they are connected to a power source, their MAC addresses will automatically appear in the table shown above. When you have added all your Pis, click Next.
On the Add users screen, you can set up users on your server. These are pairs of usernames and passwords that will be valid for logging into the client Raspberry Pis. Don’t worry, you can add more users at any point. Click Next again when you’re done.
The Add software screen allows you to select the operating system you want to run on the attached Pis. (You’ll have the option to assign an operating system to each client individually in the setting after the wizard has finished its job.) There are some automatically populated operating systems, such as Raspbian and Raspbian Lite. Hopefully, we’ll add more in due course. You can also provide your own operating system from a local file, or install it from a URL. For further information about how these operating system images are created, have a look at the scripts in /var/lib/piserver/scripts
.
Once you’re done, click Next again. The wizard will then install the necessary components and the operating systems you’ve chosen. This will take a little time, so grab a coffee (or decaffeinated drink of your choice).
When the installation process is finished, PiServer is up and running — all you need to do is reboot the Pis to get them to run from the server.
Shooting troubles
If you have trouble getting clients connected to your network, there are a fewthings you can do to debug:
- If some clients are connecting but others are not, check whether you’ve enabled the network booting mode on the Pis that give you issues. To do that, plug an Ethernet cable into the Pi (with the SD card removed) — the LEDs on the Pi and connector should turn on. If that doesn’t happen, you’ll need to follow the instructions above to boot the Pi and edit its
/boot/config.txt
file. - If you can’t connect to any clients, check whether your network is suitable: format an SD card, and copy
bootcode.bin
from/boot
on a standard Raspbian image onto it. Plug the card into a client Pi, and check whether it appears as a new MAC address in the PiServer GUI. If it does, then the problem is a known issue, and you can head to our forums to ask for advice about it (the network booting code has a couple of problems which we’re already aware of). For a temporary fix, you can clone the SD card on whichbootcode.bin
is stored for all your clients.
If neither of these things fix your problem, our forums are the place to find help — there’s a host of people there who’ve got PiServer working. If you’re sure you have identified a problem that hasn’t been addressed on the forums, or if you have a request for a functionality, then please add it to the GitHub issues.
129 comments
Bob Waterson
Why did you need to create this when there was already PiNet which the foundation could have supported allowing more time to other projects.
Gordon Hollingworth
We are really happy with the PiNet software and it’s been one of the great community supported projects.
PiServer was developed to encompass a broader functionality, to work for industrial Raspberry Pi solutions as well as in the classroom. It allows a user to install different operating systems to different clients and is a more generic solution for our OS providers as well. We also utilise the latest Raspbian / Raspbian Lite images and have an automated method of creating it so that all future releases will immediately be available on PiServer.
0pendev
Amazing piece of tech !
I’m looking forward o see what the ocmmunity will do with it ;)
Tom Archer
I run a Royal Institution Masterclass which uses networked Raspbery Pis. Normally the day before the class we have to spend a few hours updating 15+ Raspberry Pis with whatever the latest version of Raspbian is and then coping over all the files for the class. Definitely going to look into this as it has the potential to save a lot of setup time (and SD cards)!
Jonathan Pallant
I think you need to boot each Pi at least once with the program_usb_boot_mode=1 line in place, otherwise it won’t USB boot. The instructions above say to add the line, then just power off.
https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md
Gordon Hollingworth
Yes you are right, you need to add the line to config.txt then reboot the Pi.
Gordon
Andrew Pattison
Hi Gordon. This is a great addition to the official software. Can you possibly amend the blog post to say that the Pis to be network-booted need to be booted once with the relevant setting in config.txt?
Rick
As nice as this is, it kinda puts you in a really bad light. Why didn’t you work with PiNet instead of essentially working to destroy them.
Richard Collins
I did know about this project. Having looked at their site I can see your point although I think you could have been a little more diplomatic.
I don’t think they are working to destroy anyone.
Shannon
I would tend to agree. Why are people saying this will destroy PiNet? This is all about network booting generic Pi clusters. I think PiNet is much more than that, and could probably get a shot in the arm from using this to augment what they have already done….
Jon Witts
Looking at the GitHub page for the project I can see that csv user import has recently been added: https://github.com/raspberrypi/piserver/commit/0998dae16abe1e80ab7020330dea1122ced44323
This is something I have been looking at myself and posting to the forums about; although my progress has been somewhat slower ;-) https://www.raspberrypi.org/forums/viewtopic.php?f=116&t=199472&p=1254209
When can we expect to see the csv user import settings make their way into the apt repos?
Great work by the way! :-D
Jon
Richard Collins
Great work :) You make the most usable Linux distro. (for me)
me
Are you guys preparing a blog post reassuring us about the major security flaws in ARM chips (and others) found yesterday? Just read BBC news page about this. The security bug that affects ARM-based computers is called ‘Spectre’ I believe.
I’m not worried about cyber criminals at this stage, but there’s word that cpu performance might be hit and I question whether third party OSes generously run by unpaid developers will even be able to patch their distros
Raspberry Pi Staff Simon Long
I’m not sure what “reassurance” you are hoping for. Pi is ARM-based – any security flaw in the ARM core will affect us, as it will any other device with an ARM in it, which includes pretty much every other SBC out there, every smartphone, every satnav, most IoT devices – basically anything with any more intelligence than a toaster will be affected by an ARM security flaw, and we are not immune.
The only real mitigation we can offer is that anyone using Raspbian Stretch has a very up-to-date version of the Linux kernel, and we pull in patches on a very regular basis. As soon as a fix is released for this in the kernel, it will be available on the Pi shortly afterwards, but we don’t at present know when that is likely to be. Keep an eye on here and on the forums for updates – but really, all the reassurance we can give now is to say that we are aware of the problem and we will make a fix available as soon as there is one for other ARM-based devices running Linux.
playback
There is enough information round the net to get confused. According to ARM (https://developer.arm.com/support/security-update) and Wikipedia (https://en.wikipedia.org/wiki/Raspberry_Pi) the Raspberry Pi computers are NOT affected because they don’t use processors listed on the ARM’s page above.
According to wiki:
RPI gen. 1 – ARM11
RPI gen. 2 – Cortex-A7/Cortex-A53
RPI gen. 3 – Cortex-A53
Please correct me, if I’m wrong.
Raspberry Pi Staff Simon Long
You’re quite right – I had originally heard that all ARM devices were affected, but if it is indeed the case that only ARM devices which allow out-of-order execution which are affected, then the A7 in Pi 2 and A53 in Pi 3 should indeed be ok, as both only support in-order execution. The ARM11 in Pi 1 does support some out-of-order operations for stores, but as ARM do not list it as an affected processor, then it is probably safe to assume it is also unaffected by these exploits.
Mike Redrobe
While this is mainly for Pi 3’s – which can network boot without SD, it can be used with ALL ethernet model pi:
Simply put only the single file bootcode.bin on their sd card (otherwise blank).
I have tested this and it works fine with my selection of original model B’s, B+ and Pi 2’s
hasan aslan
Hi there. So do we have to boot the old models once like rpi3 to use your method or do we just use a blank sd with that file on it and it will boot ?
Andrew
The initial boot with the particular setting in config.txt is only needed for Raspberry Pi’s which can actually boot from the network directly – i.e. Raspberry Pi 3’s and Raspberry Pi 2’s with a BCM2837 SoC. You can run that step on the other models of Pi if you like, but it won’t do anything useful.
Dan O’Hara
I’ve not been able to get this to work on anything other than a Pi3. Putting bootcode.bin on an SD card didn’t work for either a Pi1 or Pi2B v1.1. The 2 LED’s light up on the pi2, but the lights on the ethernet jack never do. Any hints?
Brian Peters
I feel it is a real shame the Foundation is instead of working with the developer of PiNet, they just decided to go and make their own with not even a mention of it in the post…
It feels a waste of time, when those same resources could have gone into supporting what already exists, making a better experience for everyone.
Instead, we now have 2 competing systems that do slightly different things, which will simply confuse the end user. But this system will chances win out anyway, the entire Raspberry Pi Foundation vs an unpaid open source volunteer.
What is the point of the PiNet developer even continuing now at it? As (I am pretty sure anyway) he/she did it solely in their free time unpaid, now they are up against something with the resources of the Raspberry Pi Foundation.
Don’t get me wrong, it looks like a great piece of software, but just seems like it flies in the face of the work that has already gone into a community project, instead of working with them for the better of everyone.
Henk Hofstra
nice pointer Ake !
Brandon
Does this work with Zero W’s? I have a system that would be great to have a Pi 3 as the server and have the Zero’s as clients to send data and receive commands.
Andrew
No. Only the BCM2837 has the required boot code inside it. The Pi Zero and Zero W use the BCM2835 which does not contain the required boot code. You can however use the bootcode.bin method as described by other comments here on any model of Pi which cannot boot directly from the network.
Simon Lambourn
This is a great facility. I am wondering if you plan to make a .deb file available for PiServer as I’d like to run it on an ubuntu server rather than installing Debian. I can’t find a reference to it in the documentation.
infinitytec
How hard would it be to have a custom peice of software run on the OS?
Floris
Depends what your customer software wants to do.
Adding custom software is not so hard by itself.
However if you want it to run automatically without any user being logged-in, your software needs to be able to run from a read-only file system.
The home directory of the user that is logged in is the only writable location.
Paul Webster
How is the Raspbian distribution that is held on the X86 server updated?
Presumably a special way to run
apt-get update
apt-get dist-upgrade
making it apply to the image files for a different architecture.
Gordon Hollingworth
You can chroot into the image using qemu, see:
https://github.com/raspberrypi/piserver/tree/master/scripts
Then you can locally update…
Floris
Alternatively, if there is a newer major version available, and you are using a standard image from the repository (that you did not modify), you can also simply replace the entire image with the latest version.
In the main Piserver interface under the “Software” tab, there is an “update” button for that purpose.
It is currently greyed out, but it becomes clickable when it detects there is a newer version of the OS you installed available on the repository.
Note that the /home directories that have your user’s files are stored separately, and are not specific to any operating system.
So replacing operating system files does not affect them.
Bruce Ferrell
uh… guys. PiNet is just a canned version of this… And PiNet is a re-hash of Linux Terminal Server Project (with the barest of mentions).
Mr Lee
How are the OS updated? Or say, if I wanted to added an application, would I need to create a new image and provision the new image to clients?
Mr Lee
Oops…same question as Paul Webster
Mark
Gordon, this is great. However, I am doing the opposite and using a Pi as a file server, which also works well.
Can I suggest that the Foundation stop using the term “Pis” as it looks rather vulgar and note that the correct pluralisation of Pi is actually Pies.
Sorry for being a pedant, but this has been bugging me for a long time.
Raspberry Pi Staff Simon Long
I’m sorry, but if we’re being pedantic, the singular of the word “pies” is not “pi” but “pie”. The plural of the Greek letter “pi”, which is what the name of our product includes, is “pis”. You’ll just have to get used to it!
Eric Olson
To make the plural of a single letter often an apostrophe is used. For example, the student made straight A’s in all courses. Since Pi is, in fact, a single Greek letter, following this same rule leads to statements such as all Pi’s are great.
At the same time, an apostrophe is never used when making the plural of a name and Pi is arguably the name of a type of computer. Thus, advice such as don’t scatter your Pis all over the floor also seems reasonable.
When a letter is used as a name, which rule takes priority?
More on topic, it would have been nice from a user’s point of view if the user interface introduced by PiNet for adding and deleting students and Pi computers was also used for the new system. Note how the plural of Pi was dodged in the previous sentence. Future coordination leading to interoperability and transferable skills has merit.
Raspberry Pi Staff Simon Long
“To make the plural of a single letter often an apostrophe is used.”
It frequently is, but like many other uses of the apostrophe in our day and age, it is not strictly correct to do so…
DPyles
Really? This is what you choose to post?
How about just PIs. Move on.
William
What exactly can I do with this? can I essentially turn all of my Pis into one machine?
William
And share tasks between them natively?
Rishi
The instructions depict a GUI wizard to manage PiServer – is it also possible to set up PiServer entirely via terminal, so it can run on headless servers?
William Smith
I have this question as well, all of my Linux boxes are headless, and I’d love to do this headlessly.
Thanks!
Floris
There is no console version of Piserver.
Although if your normal desktop computer runs Linux as well, you should be able to start it through SSH X11 forwarding:
ssh -X pi@raspberrypi.local
sudo bash
xauth merge /home/pi/.Xauthority
piserver
Calvin Chow
Can we run the client Pis headless as well? trying to figure out how to netboot the clients with a static IP would help in this case.
grammar boy scout
Actually if you look in the file /etc/default/xrdp, there appears to be some conf settings for the *nix port of M$ RDP which can be installed with your standard package manager [apt]. This would be an additional option to xwindows.
Navyscourge
If you are using Windows, and want to connect to a headless PiServer, install Xming (a Windows X server) and Putty (a Windows SSH client). Start Xming, then Enable port forwarding in a Putty session and start the session. You should get a terminal window asking you to login to your server. At the Linux prompt, type ‘piserver’. Add a ‘&’ to the line to run it in background, so pressing return gives you the Linux prompt so you can type other commands. Install something like ‘screen’ to give you a terminal that keeps running when you exit your SSH session; you can reconnect to it when you login next time.
Don Mitchinson
This looks like an awesome project. Thanks for creating it.
I have one question regarding the client and server connections – the diagram and “Add Clients” screenshot both show an Ethernet connection between client and server.
Will PiServer work with WiFi connected clients – or are there other complications that come up with that type of setup? Does the server have to be configured as a WiFi Access Point and wpa_supplicant.conf preconfigured somewhere on the client?
Andrew
You can only network boot using a wired network connection. It is almost always a bad idea to try to boot over wifi, and in fact there is no such thing as PXE over wifi. (PXE is how network boot works on the Pi).
Steve
How can I enable SSH, VNC and or Serial on the client PIs so that when they boot up I can log in headless?
MW
It seems that there was a reason for x86 RPD after all..
In the blog it states Raspberry Pi 3B, but does the Network Boot also apply to the Raspberry Pi 2 – Model B V1.2 BCM2837 ??
Can we have official confirmation, as mentioned above, that SD Card bootcode.nin will work for all Raspberry Pis
https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/README.md
Regards PiNet whilst a great piece of software it is not as yet using Raspbian Stretch as far as I am aware.
Andrew
There are many reasons why an x86 version of the Raspberry Pi Desktop is useful – this is only one of them.
The bootcard.bin method has previously been confirmed as permitting exactly this type of partial network boot. It has also been confirmed that newer Raspberry Pi 2’s, those with the BCM2837 SoC, can network boot on their own without any SD card.
William S Grimaldi
Can you specify a URL or IP to boot from?
Floris
Normally Piserver will serve the files to be booted.
While you could technically tell the Pi to download the tftp boot files from another IP, that will only work if the IP is in the same subnet, as the PXE boot code does not support using gateway.
So booting arbitrary files over the Internet will not work.
Antonio Carlos
I have done some quick tests last week using isc-dhc-server and the boot seemed to work even when the tftp server is not in the same subnet. The tests failed when using Microsoft dhcp server.
Analyzing the differences I have noticed that the RPI3 (model B) PXE boot code does not seem to ask for DHCP options 1 “Subnet Mask” and 3 “Router” (suboptions of option 55 “Parameter Request list”) during the request/offer process. Even so the isc-dhc-server sent these data, while the Microsoft dhcp server did not. This could explain this difference in behavior.
Is there any way we can confirm that? I’ll do deeper tests next week. In the meantime, there is how you can verify if the model B+ has the same behavior?
Jeff Hopper
Brilliant, excellent work! This should work really well in a classroom setting. Looking forward to trying this out, especially with wifi. Targeted configuration will be PiServer with file system behind wifi router, networked Pis will connect and boot over wifi.
Floris
Will only work with wired connections.
MovLab
Hi There, Just to mention I have the piserver on an old dell and that is connected to my home network with wifi on 5 gh’s. My pi’s are connected to the home network with an Ethernet cable. The system works well..
We do need a good manual for this project. I am able now to ssh into my pi’s ok now after figuring out how to do it.. But The file system is read only :(, and im not also on the sudoer’s list to do anything on it .
So it’s a work in progress now.
MovLab
Steve
How can I enable SSH, or Serial on the client PIs so that when they boot up I can log in headless?
Floris
In the main Piserver interface you get after initial installation: go to the “software” tab -> press the “console” button
This gives you a qemu powered chroot shell into the installed operating system image, in which you can make tiny modifications.
If you want to enable SSH server functionality make sure that you do not only enable SSH, but also generate SSH host keys.
Raspbian normally does that on first boot instead, but since the file system is read-only to the clients that is not possible for them to do.
ssh-keygen -A -v
systemctl enable ssh
May also be able to use programs like raspi-config
Starting simple X applications should work as well, as long as they are not using dbus.
Jonathan Sanderson
Awesome.
Does this work from a VIrtualBox-hosted Raspbian x86 server? I’d test it myself but my ethernet switches and Pis don’t live in the same offices…
Floris
Yes, as long as the networking mode of your virtual machine is set to bridge instead of NAT.
(Select your VM -> “settings” -> tab “network” -> attached to “Bridged adapter”)
Also make sure that when booting Pixel you select the “install to hard disk” option (and not “run with persistence”)
Jonathan Sanderson
Awesome, thanks! That gives a bunch more options for getting this working. Great stuff.
Floris
BTW another note: in case Virtualbox gives Pixel a tiny 640×480 window in which Piserver does not fit, make sure you install the Virtualbox guest additions.
“Devices” -> “Insert guest additions CD image”
Open a shell:
sudo mount -o remount,ro,exec /dev/sr0
sudo /media/cdrom/VBoxLinuxAdditions.run
MW
Pixel has been retired and it is now Debian Stretch with Raspberry Pi Desktop and on the boot up screen “Raspberry PI Desktop powered by Debian”
https://www.raspberrypi.org/downloads/raspberry-pi-desktop/
Someone above made a comment about x86 Raspbian, it is not Raspbian which is ARMHF.
Rex
Hi Floris,
It’s regarding running PiServer in Raspbian in VirtualBox (Raspbian is installed), I did the “bridge mode” and got an IP address from my router.
Also did the procedure to make RPi3 able to network boot, it does show “17:3020000a”.
However, the PiServer in the Virtualbox doesn’t seem to get MAC from the RPi3.
Do you have any idea for what could go wrong?
Thank you.
m
Make sure there is no blank line at the end of config.txt
Taubin
Unfortunately I’m having the same issue. It won’t see the pi at all. I made sure there are no spaces, but it still doesn’t see it. Not sure what’s going on or how to fix it.
Pieter van der Hijden
IMHO the PiServer should be running first, then you connect and switch on the client machines.
It looks as if the boot from network is only tried once. If it fails (because PiServer is not running yet), the client hangs in an undefined state, i.e. is not trying gain to boot from the network.
William Smith
I have a bunch of Pis running various monitoring and control things around my two homes, and one of my recurring issues is SD cards going bad after a year or two of operation, which results in my having to restore a backup image to the card or refactor the monitoring code for the latest Raspian release.
Rather than have all the Pis running the same static system, is there a way to have each one run a separate build? I’d really like my “SD Card” to never go bad, but I need a way to install software and make configuration changes…
Thanks!
Floris
That is not a use-case supported out-of-the-box.
Although technically you could edit /etc/exports manually to make the server share the NFS share read-write instead of read-only.
And add Raspbian multiple times under different names.
Only do so in a private home network (and NOT in a school or other public setting), as you are then essentially sharing that folder with anyone who can connect to your IP.
There is no reliable way to tell if the client connecting is really your Pi or someone else.
Stephen Edgar
It’d be great to be able to serve a Docker image, or a Docker Swarm with the Pi’s connecting…
Esbeeb
Can we talk a bit about disk I/O throughput and Network throughput? My understanding is that you can get about 10MB/sec disk i/o to a Class 10 MicroSd card on a Pi 3, but the Pi’s ethernet only gets about 3.5 MB/sec, due to the ethernet controller being behind the USB controller (wheras you would expect about 12 MB/sec from any other off-the-shelf 100 mbit/sec ethernet card). So I see each Pi 3 gaining huge CPU performance from a PiServer server. But I predict serious disk I/O losses: going from 10 MB/sec down to about 3.5 MB/sec. I see 10 MB/sec disk I/O being a serious bottleneck already in the Pi (and I personally *always* try to have at least 20 MB/sec disk I/O, achievable on a decent USB stick like a Sandisk Ultra or Sandisk Extreme, *with the ext4 filesystem, not vfat*).
Can anyone attest to disk I/O/network throughput speeds that the Pi 3 clients achieve (as a sustained average, over, say, 2 minutes of heavy I/O, not as a brief, temporary burst)?
Esbeeb
Dear RasPi foundation. I love you guys. I love every new hardware gadget you invent, and every software you design as well. *Please add gigabit ethernet to the RasPi 4*. Then your PiServer will rock, and Network I/O speeds will easily rise above the aforementioned 20 MB/sec dotted line of painfulness.
Even a bargain basement “Trendnet”-brand 8-port gigabit switch will yield a very-decent, sustained 50 MB/sec (at least one such connection).
PS: as a former Linux SysAdmin with a B.Sc. in Comp. Sci., *I’m going to strongly recommend not connecting more than 40 Pi Clients to a PiServer*. Why not? Because NFS in Linux will probably start falling on its face at about that point (and I speak from battle-hardened experience).
NFS for Linux is nowhere as rhobust as NFS for Solaris (the native homeland of NFS). But 40 PiClients, all under heavier, realistic, real-world loads to run smoothly for months on end, I will be very pleasantly surprised, and delighted.
Esbeeb
BTW: my warning about not exceeding 40 clients applies when the NFS exports get mounted *read-write*. You can probably greatly exceed 40 if the NFS exports are mounted read-only. Read-only greatly simplifies your use case, from an NFS point of view. But other bottlenecks will probably stop you from going much higher than 40 Pi Clients anyway, such as: how many ports do you have on your good-quality gigabit+ switch, and how many MB/sec will each Pi Client realistically get out of that switch under heavy loads?
You probably want 10Gbit on your Pi Server, (or at least bonded dual Gigabit).
Network throughput will really matter, so I strongly recommend sizing your PiServer and switch(es) around that.
Having said all this, < 40 Pi Clients per Pi Server is probably enough for any one classroom, at any rate.
Floris
NFS is indeed mounted read-only.
Only writable location is the user’s home directory which does not use nfs but is mounted through sshfs.
That may not be the best performing solution either in theory, but given that the typical user would only use it to store his scratch/python work and not to run bonnie++, it should be ok in practice.
Perri Peterson
Hello, are data (files) stored separately for each user profile or it’s shared? Has netboot any disadvantage of RAM usage?
Thank you
Perri Peterson
I mean files from home folder ex. .local, .config,… folders
Gordon Hollingworth
Yes the home folders are mounted separately (in fact you share the home folders that are on the server), there are a number of tmpfs filesystems that are used to store other things (like log files) which take up RAM so it will effect RAM availability by around 10%
Gordon
rolinger
Brilliant idea, good to see something that makes LTSP applications more user-friendly, I can see some good industrial applications.
I think you need to work on your name-generator though, PiServer was already used for some hardware on the blog just over a year ago https://www.raspberrypi.org/forums/viewtopic.php?f=40&t=158927 ?
Mike C.
This is great for learning and small labs, but wouldn’t there be a problem at scale for say an industry? There will be some point where the network traffic generated would become saturated and then it would make more sense for each device to have an SD card. I guess the question is at what point does this happen and when it does it no longer make sense to have 100% of your OS’s IO traffic “over the wire”?
PS: I’m glad to see this project along with PiNet! The great thing about open source communities is that we all learn and benefit from more than one project. Keep up the good work!
Eric Olson
Mike C. says:
This is great for learning and small labs, but wouldn’t there be a problem at scale for say an industry?
Response:
In an industrial setting one might expect there to be a hired IT professional with the skills necessary to set up a suitable network. Therefore, it is better not to make the easy-to-install PiServer more complex with added functionality to handle this situation.
From a technological point of view, a single LDAP server can serve thousands of user credentials and if those limits are exceeded, LDAP servers are designed to be clustered together. Since a single NFS server might only handle 100 or so mounts, you will need multiple NFS servers at scale. Still, it should be sufficient to statically partition the home directories and the root file systems between the servers to distribute the load. Clearly 10 servers are much easier to manage than 1000 SD cards, especially since servers usually have remote management tools.
asandford
From what I gather, the OS is mounted r/o so there is no ‘OS’s IO traffic “over the wire”’. The client uses ram for OS files that need to be r/w.
The only traffic (after initial boot) would be i/o with the home directory.
moss
more info about this commandline snippet
> echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt
>> “This adds the line program_usb_boot_mode=1 to the end of the config.txt file in /boot.”
can be found in the link hear : https://explainshell.com/explain?cmd=echo+program_usb_boot_mode%3D1+%7C+sudo+tee+-a+%2Fboot%2Fconfig.txt
Alex Ellis
I struggled with netbooting and RPi3 – wrote up some of that here last week – https://blog.alexellis.io/the-state-of-netbooting-raspberry-pi/ – wondered if these issues have been cured for the new PiServer ?
Floris
Double check your dnsmasq.conf has a line like:
dhcp-reply-delay=1
Which solves some of the problems.
You should have that already by default if you installed the standard Raspbian dnsmasq package though.
Oh, and the “unique TFTP root per MAC” patch you mention on your blog was written for Piserver.
So yes, the package has that one applied as well.
(And was accepted by upstream as well, so other distributions should have it in the future as well)
Gordon Hollingworth
Floris is awesome… Just saying
:)
hlev
When working on network booting the Pi for our project, delaying the DHCP response did not seem reliable enough on its own.
On top of dhcp-reply-delay=1 for dnsmasq, I’d recommend sending an odd multicast packet periodically say every 5-10s, which will kick any Pi on the LAN into life that refuses to netboot despite a valid DHCP offer.
This can be done with socat for example:
echo “hello” | socat – udp4-datagram:224.0.0.100:24000
1. the payload is arbitrary
2. choose a multicast IP that is preferably not reserved for other services
3. same goes for the port
Floris
Have never needed to during my testing.
But an easy way to generate some minimal periodic broadcast traffic is to add to /etc/ntp.conf a line among the lines of:
broadcast 224.0.0.1 minpoll 4
vasimv
It is possible to make network boot for Pi zero W through USB-net (when several Pi zeros connected by usb cables to Raspberry PI 3 host?).
Everette
Since Raspberry Pi Desktop (for PC and Mac) exists as a distro it seems like a good place to add PiServer support. Any thoughts by the Foundation on making this happen or are there reasons we are bound to x86 Debian Stretch?
MW
Not sure what you are stating, the Debian Stretch with Raspberry Pi Desktop includes PiServer by default.
Basically this OS is Debian x86-32 with a modified LXDE Desktop environment.
https://www.raspberrypi.org/downloads/raspberry-pi-desktop/
onzl
Can I use it with PIs that have different software installed? For example, I have a couple of PIs running Motion, I have a PI with Home Assistant, I have PI managing my security, etc…. Can I use them without SD cards if I connect them to the server?
Or is it only for standard Stretch, users and file system?
Esbeeb
Here’s some interesting tidbits to contemplate (for the hard-cores out there who would like to get their hands dirty):
The Asus Tinkerboard has both a Gigabit ethernet port (not to mention a faster Micro SD card reader), *but it can’t PXE boot*. And Armbian OS is used there, not Raspbian (and I would greatly prefer Raspbian, personally).
Those with heavier loads might consider Tinkerboards (with minimalistic SD cards which have just enough Linux to boot; that is to say, has a /boot partition, but mounts the root partition over NFS). At least until the Pi has a faster ethernet port somehow.
All the minimalistic SD cards could be identical. Each Pi would get a unique IP over DHCP, and the DHCP server recognizes the Pis based on MAC address, so that Pis get the same IP address every time they boot. Furtherly, a properly configired DNS server serves the correct hostnames for each Pi.
Marcus Bernas
I’m working on touchscreen Pi for A/C climate control for each bedroom and zone in a large house (10 PIs in building). Node.JS in each Pi will serve React/HTML into Chrome “kiosk mode”, which hooks to a central MySQL repository for statistics, plus a Google Firebase real-time service to view status on all PIs, as well as control A/C units remotely. Added 12v magnet sensors in every window & balcony doors, to warn occupant if open and then shut down A/C in their rooms. With Firebase we will develop React-Native apps for iOS and Android, so users can also set A/C from their phones, plus a web/tablet/phone app to monitor entire house — and change settings in any room remotely.
We work extensively with Particle.io devices, and may integrate their PI tools to control other parts of house.
My biggest concern was updating software for every Pi, as development will be continuous (integrating outside weather infos, marine tides, fishing data, etc.). Until PiServer showed up, I was looking at replicating SD cards, doing manual upgrades and migrations, version controls, etc.
With PiServer I could imagine progressive updates by “user” or device, even a “test room” version, right off the same X86 server (with different logins). This leads to some questions or ideas to configure:
— could a Chrome “kiosk mode” Pi connect to PiServer automatically on power-on ?
— could we send a signal or command any Pi to reboot to new server settings ?
— could a backup (failsafe) system revert to a local SD version, if PiServer is down ?
— any ideas of how to configure this “industrial” application to be robust ?
As PiServer is meant for industrial solutions, I anticipate we could write different apps for different PIs on the same network, each having different roles. Its a dream for IoT projects, including video PIs, electricity monitoring, solar panels and batteries (we’re doing “island” homes, with on-grid and off-grid solutions), alarms, etc. Our first project is a single home, then we’ll work on apart-hotel models.
Thank you for any ideas and advice !
Marcus
Marcus Bernas
Hi again…
We’re thinking of MINIX NEO Z83-4 PC as our X86 server.
No need for fan cooling on 24/7 work, has 32 gb storage (may add SSD via USB).
Any thoughts ?
Andrew
Unfortunately you cannot configure the order in which the Pi attempts to boot from the various devices (SD card, USB, ethernet). You can only select which boot modes you want enabled. If you are going to have an SD card installed in the Pi anyway, then you can simply boot from that and have the Pi load the root filesystem from the PiServer, and connect the home directory using sshfs in the same way that the PiServer image does.
Esbeeb
Well said.
I agree this is the smartest way to do it, from a disk I/O perspective. You want that fast-as-you-can-currently-get 10 MB/sec from the MicroSD card for all OS and software-related disk I/O (which is to say, everything in /var, /bin, /usr/bin, /sbin, /usr/sbin, and suchlike). To have a slower home folder (3.5 MB/sec over ethernet/NFS) is substantially less damaging to performance.
PS: I ran 2 linux clusters (one redhat, one debian) doing exactly sort of this thing, back in the day, in my Sysadmin job. Trust me, you want local-to-the-machine disk I/O speeds for the OS (if they are indeed faster than network speeds, which is the usual case)..
grammar boy scout
Couple of thoughts on the PXE boot over Ethernet. My personal use for my RPi3 is to run Kodi. As my home is not wired for Ethernet to any room. So, were I to implement this a wired connection would be problematic.
However, all my TVs have WiFi and an Ethernet port. [and can even be setup as an additional AP]. It would be very interesting indeed to Tether the RPi3 thru my TV which in turn would connect wirelessly to my home wifi router.
Alternatively I could use two RPi3s on each TV. One to connect wirelessly to the Wifi router and the second to tether off the first.
Gordon Hollingworth
I’m not sure if this’ll work, it may use the TV as a gateway which the Pi bootcode won’t support. To get gateway support you’ll need to use an empty SD card with bootcode.bin copied over (on its own, nothing else).
But that still has most of the advantages, all of the file systems will still be hosted on the server.
Gordon
Asmo Koskinen
Thank you for PiServer. And sorry for spamming this (https://www.raspberrypi.org/forums/viewtopic.php?f=116&t=201770).
I think I Am almost there – Am I?
Jan 6 23:29:19 raspberry systemd[1]: Started dnsmasq – A lightweight DHCP and caching DNS server.
Jan 6 23:29:54 raspberry dnsmasq-dhcp[2456]: 653460281 available DHCP subnet: 192.168.1.8/255.255.255.0
Jan 6 23:29:54 raspberry dnsmasq-dhcp[2456]: 653460281 vendor class: PXEClient:Arch:00000:UNDI:002001
Jan 6 23:29:54 raspberry dnsmasq-dhcp[2456]: 653460281 PXE(eth0) b8:27:eb:74:e3:66 proxy
Jan 6 23:29:54 raspberry dnsmasq-dhcp[2456]: 653460281 tags: piserver, known, client_is_a_pi, eth0
Jan 6 23:29:54 raspberry dnsmasq-dhcp[2456]: 653460281 reply delay: 2
Jan 6 23:29:56 raspberry dnsmasq-dhcp[2456]: 653460281 broadcast response
Jan 6 23:29:56 raspberry dnsmasq-dhcp[2456]: 653460281 sent size: 1 option: 53 message-type 2
Jan 6 23:29:56 raspberry dnsmasq-dhcp[2456]: 653460281 sent size: 4 option: 54 server-identifier 192.168.1.8
Jan 6 23:29:56 raspberry dnsmasq-dhcp[2456]: 653460281 sent size: 9 option: 60 vendor-class 50:58:45:43:6c:69:65:6e:74
Jan 6 23:29:56 raspberry dnsmasq-dhcp[2456]: 653460281 sent size: 17 option: 97 client-machine-id 00:44:44:44:44:44:44:44:44:44:44:44:44:44…
Jan 6 23:29:56 raspberry dnsmasq-dhcp[2456]: 653460281 sent size: 32 option: 43 vendor-encap 06:01:03:0a:04:00:50:58:45:09:14:00:00:11…
Jan 6 23:29:56 raspberry dnsmasq-tftp[2456]: file /var/lib/piserver/tftproot/b8-27-eb-74-e3-66/bootsig.bin not found
Jan 6 23:29:56 raspberry dnsmasq-tftp[2456]: sent /var/lib/piserver/tftproot/b8-27-eb-74-e3-66/bootcode.bin to 192.168.1.2
Best Regards Asmo Koskinen.
Asmo Koskinen
Solved – changed my router…
https://www.raspberrypi.org/forums/viewtopic.php?f=116&p=1255780#p1255780
Best Regards Asmo Koskinen.
Howard Kirkman
Hi
I would like to run this on a Synology NAS, that runs under debian I think. Could you point me in the right direction to do this.
Thanks
Marc C. Huebner
Hi.
This would be a perfect solution for me as well!
Marc
tom flemer
The lead article in Raspberry Pi Weekly is about PiServer. I downloaded the image. Installed on a HP DL360 G5 (old) with no tweaking. Installed ifenslave to team the NIC ports. At least visually there is a significant boost in network speed from the teamed NICs. So far everything works. I did find one issue. Chromium would not allow access to the iLO server control port with outdated certificate. Installed Firefox to fix the issue. Overall very impressed with the installation and PiServer. SSH worked perfectly. Considering that most server installations will be on more robust machines vs RPis, would be great if all interfaces could be added back into the Raspconf. Nice job, many thanks.
Seasalt
Will PiServer allow “guest” login accounts. With persistence or with out persistence. Ie the next guest will find the changes made by the previous guest. etc.
serendrewpity
I’ve been able to successfully setup a PiServer server in a VM on a Qnap NAS and successfully setup, connected and booted several Raspberry Pis. So strictly from a Proof of Concept p.o.v. I’ve been successful.
However, both the Raspbian and Raspbian Lite flavors are locked down to the point that I can do little more than browse the internet, play games and perhaps perform various Office [word processing, spreadhsheet, email] related tasks.
The OS is Read-Only. When I attempt to “sudo remount -o rw,remount /”, I get “‘user’ is not in the sudoers file. This incident will be reported.” The user that the error is referring to is one of the half dozen userids I created with the PiServer tool. I am also unable to escape out to Grub’s recovery console to unlock the root passwd and made the FS read-write.
I’m not a complete noob. I know how to use google. My background is in Wintel. I tinker in *nix. Setup my tomato router(incl. wanup scripts), Qnap NAS and now Raspbian. I’ve even written apps for Palm WebOS.
What am I missing here? Help?
Gordon Hollingworth
You can start a shell on the server which chroot’s into the filesystem. From there you can do whatever you like (i.e. update the system, give users sudo access)
Jürgen Beckmerhagen
Greetings from Germany.
Thanks a lot for the fantastic Piserver-application. Since approx. 1.5 years I manage a computer class room with 19 RPI3 in our Rudolf Steiner / Waldorf School.
I just wish to know:
a) how can I create approx. 120 user names and passwords for our students?
b) how can I group these 120 users into four classes with two groups each?
c) how can I assign static IP addresses to each of the RPI-Clients, so that I can use VNC-Viewer from the teacher’s desktop?
d) how can I provide the teacher with easy access to the files in the home directories of his students?
e) can I simply run “apt-get update” from the chroot-Console of a Raspbian OS in Piserver?
Thank you very much – and Happy New Year.
Asmo Koskinen
Try Epoptes.
https://www.raspberrypi.org/forums/viewtopic.php?f=116&t=202184#p1257224
Best Regards Asmo Koskinen.
Gordon Hollingworth
If you’ve got any suggestions for additional functionality then please got to the github issues list and add there…
Winfried Münch
Hi, is it possible to use piserver over wlan?
Gordon Hollingworth
Unfortunately not, the bootcode cannot contain all the WiFi firmware used to actually communicate with the network. In comparison sending an Ethernet packet is very simple.
MovLab
Hi, I have the Piserver working on wifi. It is an old dell laptop on the 5 gig band. My test pi is on a Ethernet cable to the router. So this part works.. The pi gets the code from the wireless piserver fine. May be a bit slower, but it works.
I can ssh into the pi fine now..
MovLab
Kingaroo
Are there any plans to create a docker image for pi server?
Creepwood
Awesome product. I’m wondering, will it be availble to run from the command prompt since my debian server isn’t using any desktop environment
Muhackl
Hi,
network boot seems great. But how can I troubleshoot?
Raspbian Stretch on Dell Laptop – freshly installed an all updates.
Raspberry Pi 3 prepared as decribed above. Buth devices via LAN cable attached to the same router.
Raspberry Pi is well found as device in PiServer on the Dell Laptop and added as new device. Raspbian installed in Pi Server as described above. Rebootet. LAN lights are flashing, Act light is flashing. But attached screen (HDMI) stays blank.
How can I troubleshoot?
Many thanks and best regards
Licdll
Hi.
piserver rasberry (RASPBIAN JESSIE WITH DESKTOP) is loaded on the network without the cd maps on the client to enable autologin
jimmike
You need to read
“Raspberry Pi: Hands-On with the PiServer tool
The new PiServer package included in the latest Raspbian x86 release provides a very powerful client management tool. Here’s an example of how to configure and use it.”
by J.A. Watson, 1/12/2018; ZDNet; ‘Jamie’s Mostly Linux Stuff’.
PeterO
I scanned this thread but can’t see any mention of running the server on other flavors on Linux. My laptop (which would be ideal for use as a server) runs Mint-18.2
SO my question is : “Can a Mint-18.2 machine be used to run the server ?”
no
PiServer can’t be installed anymore: certtool throws an overflow error (Y2K38-bug).
Ted Michalik
The install is still broken:
https://www.raspberrypi.org/forums/viewtopic.php?t=204933
Raspberry.Tips
I´ve created a tutorial on how to install and use PiServer within a VirtualBox VM on your Windows Desktop. Also got a solution for the certtool error.
https://raspberry.tips/raspberrypi-tutorials/piserver-raspberry-pi-ohne-sd-karte-ueber-das-netzwerk-starten
Andy
Is possible to install piserver on ubuntu 16.04?
Andreas
Is there a description how to create other environments based on the Lite Version of Raspbian? I’d like basically any X desktop with just a few selected applications.
I tried to install a basic graphical desktop by installing the packages that would work with the Raspbian-Lite image for sd-cards.
I downloaded Raspbian Lite for PiServer, chroot into it, updated everything, installed the X stuff and swiched “boot to GUI” in raspi-config on.
It boots only to the console login.
masky
I have installed piserver from apt on raspbian stretch lite.
Are there any way to configure serials/image paths from cui?
how can I use it from console? or need to install gui later?
Yes,configure with GUI is better for everyone.but i don’t want to install huge packeages.
It think piserver uses tftp and dnsmasq like other products.
I want to pxe boot a pi from another pi pxe server.
stein
Is ist possible to use the piserver with an existing dhcp- and ldap-server? I’m working at an elementary school with an existing network (linuxmuster.net). Therefore every pupil has its own username,password and workspace.
Paul
Is there anyway to configure cron tasks and startup options for the image? Or is this just configured on the client side for each unit?
RR
How resilient is this to network issues such as temporary disconnects? If I temporarily unplug the network cable and plug it back again, I seem to need a full reboot.
IC
Hello, is there a guide how to create a own configured “.tar.xz” OS file to boot from. I dont want to use Raspbian stock images. I want that serveral clients boot a preconfigured filesystem.
Comments are closed