Edit: I found a better way do do this with Docker! Still, this might be useful if you want to install the NFS server on the host itself…
Just writing this down before I go completely nuts…
NetBoot – the gift that keeps on giving! So, it turns out, in my environment at least, you can’t NetBoot a Mac that has an APFS formatted volume. My NetBoot environment is set up around Pepijn Bruienne’s awesome BSDPy like this:
- Ubuntu Server 16.04 VM host
- Docker containers providing these services:
I set my server up following Graham Gilbert’s excellent guide.
DHCP/BSDP stage – fine. TFTP stage – fine. Then the progress bar that signifies the HTTP bit appears. And stays. Forever.
Killing the APFS volume and re-partitioning the drive with good old GPT and HFS+ resulted in NetBoot working properly for both versions of macOS. I didn’t want to break the news to our technicians that they couldn’t NetBoot a newly purchased Mac (because we don’t want 10.13 yet and want to revert it to 10.12!), without first booting it into recovery and nuking the drive first. Actually, you have to do this regardless because you need 10.13’s Disk Utility to do the deed (but it still leaves the issue of being unable to boot an APFS Mac to a 10.13.x NetInstall…).
It turns out, after some trial and error, that it’s HTTP’s fault. Serving NetBoot images over NFS instead works perfectly. And it seems to be faster.
N.B You do sacrifice a bit of security as with NFS, even though your exports (shares) are read only, you can mount the directory and see its contents from clients. If you’ve got anything sensitive in your NetBoot images, this might be a concern. Anyway…
NFS on Ubuntu, how do I do?
The point of this post is a quick and dirty how-to for getting NFS up and running with BSDPy in Ubuntu (switching over from HTTP). At first, I wanted to have NFS running in a Docker container but it didn’t work for me (because I’m rubbish at Docker, probably). I went the easy route and installed it on the host itself. Here’s what I did:
Run these commands as root:
- Install the NFS server goodness:
apt-get install nfs-kernel-server
- Create a symbolic link of wherever your NBIs live (on my server they’re in /usr/local/docker/nbi) to /nbi
ln -s /usr/local/docker/nbi /nbi
- Serve up your /nbi directory by editing the /etc/exports file:
echo "/nbi *(async,ro,no_root_squash,insecure)" >> /etc/exports
- Restart the NFS service:
service nfs-kernel-server restart
- Check that NFS is working properly – It’s easy on a Mac: In Finder, click the Go menu, choose Connect to Server… and enter the URL: nfs://your.server.ip.address/nbi – you should be able to see your NetBoot images.
- Configure BSDPy: Change these options and restart it (this assumes you’ve followed Graham’s guide – otherwise it shouldn’t be too difficult to work things out in your environment):
- Add BSDPY_PROTO=nfs
- Remove BSDPY_NBI_URL=http://$IP (don’t set this one at all)