Here are instructions for setting up NetBooting on Mac OS X Leopard. I tested it on version 10.5.2. Most of the setup has been put into one well-commented script; cut and paste the script, save it as “set_up_netbooting.sh”, and then open the Terminal and run “sudo bash set_up_netbooting.sh” in the directory the script is in. The script will created directories for netboot files, enable NFS, activate a TFTP server, and create a property list that controls a BSDP/DHCP server. [You don’t particularly have to know what these things are, but note that internet sharing (System Preferences -> Sharing -> Internet Sharing) may interfere with the BSDP/DHCP server, and vice versa.]
Be sure to look at the optional steps and troubleshooting tips that follow the script. Without further ado, here is set_up_netbooting.sh:
#!/bin/bash
# This script sets up netbooting on a Leopard (Client) machine.
# START WITH SOME SANITY CHECKS
# -----------------------------
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "You must run this script as the root user. (Try \"sudo $0\")"
exit 1
fi;
# check that this is Mac OS X Leopard (Client)
if [[ "`sw_vers -productName`" != "Mac OS X" ]] || [[ "`sw_vers -productVersion`" < "10.5" ]]; then
echo "The script is designed to be run on Mac OS X Leopard, on a non-server version."
exit 2
fi;
# CREATE DIRECTORIES AND SIMLINKS NEEDED FOR NETBOOTING
# -----------------------------------------------------
mkdir -p /Library/NetBoot/NetBootSP0
mkdir /Library/NetBoot/NetBootClients0
chown root:admin /Library/NetBoot/NetBoot*
chmod 775 /Library/NetBoot/NetBoot*
cd /Library/NetBoot
ln -s NetBootSP0 /Library/NetBoot/.sharepoint
ln -s NetBootClients0 /Library/NetBoot/.clients
# EXPORT NETBOOTING FOLDERS OVER NFS (NETWORK FILE SYSTEM)
# --------------------------------------------------------
echo "/Library/NetBoot/NetBootSP0 -ro" >> /etc/exports
# Note that as soon as the file changes, the OS restarts the NFS daemon
# START UP THE TFTP (TRIVIAL FILE TRANSFER PROTOCOL) SERVER
# ---------------------------------------------------------
mkdir /private/tftpboot/NetBoot
ln -s /Library/NetBoot/NetBootSP0 /private/tftpboot/NetBoot
service tftp start
# SET UP BSDP (BOOT SERVICE DISCOVERY PROTOCOL)
# ---------------------------------------------
# Create the /etc/bootpd.plist file.
# This file below is based on information from the bootpd man page.
# It configures a DHCP server to allocate addresses
# from from 192.168.127.10 to 192.168.127.225, on the
# ethernet (en0) port, with NetBooting extensions.
echo '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Subnets</key>
<array>
<dict>
<key>allocate</key>
<true/>
<key>name</key>
<string>192.168.127/24</string>
<key>net_address</key>
<string>192.168.127.0</string>
<key>net_mask</key>
<string>255.255.255.0</string>
<key>net_range</key>
<array>
<string>192.168.127.10</string>
<string>192.168.127.225</string>
</array>
</dict>
</array>
<key>bootp_enabled</key>
<string>en0</string>
<key>detect_other_dhcp_server</key>
<true/>
<key>dhcp_enabled</key>
<string>en0</string>
<key>netboot_enabled</key>
<string>en0</string>
<key>old_netboot_enabled</key>
<string>en0</string>
</dict>
</plist>' > /etc/bootpd.plist
service bootps start
# WE ARE FINISHED
# ---------------
echo "NetBoot setup script complete. Please be sure to follow the instructions for additional steps you must take."
Optional steps:
You may want to share additional directories over AFP. Go to System Preferences -> Sharing -> File Sharing. The /Library/NetBoot/NetBootClients0 and /Library/NetBoot/NetBootSP0 folders might be shared automatically, behind the scenes (but I’m not certain of this).
BSPD servers (which advertise the netbooting volumes) seem to advertise themselves. If, however, you want your computer to act as a DHCP server as well, you will need to set a static IP address. Go to System Preferences -> Network, duplicate the “Automatic” location (call it something like “DHCP Server”) and set your ethernet IPv4 to 192.168.127.1 (as specified in the script).
After that, you will just need to populate the /Library/NetBoot folders. This setup works really well with a NetInstall set created by Net Restore.
Troubleshooting
Look at system.log in the Console (in /Applications/Utilities); you should see messages from the BSPD server when clients try to connect.
If things stop working, executing “sudo service bootps start” may help.
The make the server forget which of several NetBoot volumes a client last connected to (and which the client will continue to connect to when you hold down ’n’ at startup), issue this command: sudo rm /var/db/bsdpd_clients
To force BSPD to re-read the configuration files (and re-examine the NetBoot folders), issue this command: sudo killall -HUP bootpd
You can boot a client in verbose mode. Hold down Cmd-V on the client’s keyboard after it starts booting up the network image.
Here are instructions for setting up NetBooting on Mac OS X Leopard. I tested it on version 10.5.2. Most of the setup has been put into one well-commented script; cut and paste the script, save it as “set_up_netbooting.sh”, and then open the Terminal and run “sudo bash set_up_netbooting.sh” in the directory the script is in. The script will created directories for netboot files, enable NFS, activate a TFTP server, and create a property list that controls a BSDP/DHCP server. [You don’t particularly have to know what these things are, but note that internet sharing (System Preferences -> Sharing -> Internet Sharing) may interfere with the BSDP/DHCP server, and vice versa.]
Be sure to look at the optional steps and troubleshooting tips that follow the script. Without further ado, here is set_up_netbooting.sh:
Optional steps:
After that, you will just need to populate the /Library/NetBoot folders. This setup works really well with a NetInstall set created by Net Restore.
Troubleshooting
sudo service bootps start” may help.sudo rm /var/db/bsdpd_clientssudo killall -HUP bootpd