Netbooting Macs under Linux
There are numerous web pages describing Apple's Netbooting
technology and
how to set it up under Mac OS X server. This web page describes how to use a
Linux server to netboot Macs.
It is not for the faint-hearted - a good working knowledge of Linux and especially
how to patch and compile software is needed.
server-name "212.240.16.7";
next-server 212.240.16.7;
#these lines tell the client the address of the server from which to retrieve
the ROM file.
option mac-version 0:0:0:0;
#This specifies the protocol version? and is always set to four nuls.
option mac-user-name "netboot";
#this specifies the user name which clients will use to log on to the server
option mac-password "abcdefg";
#this specifies the password which clients will use to log on to the server
option mac-nb-img d4:f0:10:7:2:24:2:6E:62:0:0:0:0:2:6:73:68:0:68:64:31;
#this specifies the path to the shared HD image. See section below on AFP paths.
#this represents a file called "hd1" in a folder called
"sh"
on a server volume called "nb".
option mac-apps-img d4:f0:10:7:2:24:2:6E:62:0:0:0:0:2:6:73:68:0:68:64:30;
#this specifies the path to the Applications HD image. I point this to a blank
image. See below.
#this represents a file called "hd0" in a folder called
"sh"
on a server volume called "nb".
subnet 212.240.16.0 netmask 255.255.252.0 {
#tells dhcpd which subnet to expect queries from.
host nb-153 {
#client hostname - only used internally by dhcpd
hardware ethernet 00:50:E4:B9:EC:24;
#specifies the hardware address of this particular client
fixed-address 212.240.19.153;
#specifies the IP address to be used by the client. obviously this must be unique.
option mac-machine-name "NB-BML-FictLib-1533-IP19.153";
#specifies the machine name (as in File Sharing control panel)
option mac-client-nb-img
d4:f0:10:7:2:24:2:6E:62:0:0:0:0:2:6:43:6C:0:31:35:33;
#this specifies the path to the client's private disk image. this
must
be unique.
#this represents a file called "153" in a folder called
"Cl"
on a server volume called "nb".
}
}
This is a very basic configuration for a single machine. Most of the values
will have to be changed for your setup. Obviously you will need one host entry
for each machine you intend to netboot.
The various common parameters specified in the top part of the file can instead
be specified on a per-host basis. This would allow you to use different disk
images on different machines for example.
11. Start up the patched version of dhcpd.
12. Start up your client Mac. You will need to do one of the following the first
time you netboot a Mac: hold down N at startup; set Startup Disk control panel
to Network Disk; unbless the system folder on the hard disk; remove the hard
disk.
13. That's it. email me at ali@gwc.org.uk
to tell me if it works or not.
Setting up shared Hard Disk images
Easy technique:
1. Launch Disk Copy and do Image... New Image.
2. Change size to Custom and enter the size you want your disk image to be.
You will need space for MacOS, any applications you want on the disk image and
for virtual memory.
3. Uncheck the "zero blocks" option as this will slow the
process
down considerably.
4. Save the image on your netboot server.
5. Format the image as HFS Extended.
6. Put everything you want on the disk image, including a suitable system folder.
7. Unmount the image.
8. Do Get Info on the image file and tick the box marked Locked.
Slightly harder technique (recommended):
1. Get any Mac whose hard disk contents are not important.
2. Boot the Mac from CD and launch Drive Setup.
3. Select the hard disk and click initialise. Choose custom setup and make the
first partition the size you want your netboot hard drive to be. You will need
space for MacOS, any applications you want on the disk image and for virtual
memory. Initialise the disk as Extended HFS.
4. Install MacOS on the hard disk, either from CD or over the network.
5. Install any apps etc. Basically make the machine the way you want your netboot
clients to be.
6. You may wish to install the Netboot Drive Unmounter extension from Apple.
This will temporarily prevent access to the hard disk while a machine is netbooted.
7. Boot from CD and log on to your netboot server.
8. Launch Disk Copy and drag the hard disk icon over the Disk Copy window.
9. Change Format to Read/Write (important) and uncheck Mount Image.
10. Save the image on your server.
11. Select the image file in the Finder and do Get Info. Check the Locked checkbox.
When devising netbooting Apple made provision for a second shared disk image,
so that the system could be stored on one disk image and applications on a second.
I found this feature to be totally useless but you need to provide the client
with a valid path to this Applications disk image or the whole thing won't work.
I suggest taking one of the client private disk images and putting a copy alongside
your shared hard disk image. Do get info on the image and lock the file. Now
on the server zero the file out by doing "cat /dev/null >filename' where
filename is the name of the image.
There are various other techniques for setting up disk images I have learned.
These are to do with dealing with printers, and with using login software such
as MacAdministrator. Email me at ali@gwc.org.uk if you want to know about these.
Small tip - thanks to Michael Clark <michael@metaparadigm.com>. If your
machine starts up and complains it can't find a Macintosh Manager server, remove
the Multiple Users Startup extension on your hard disk image,
About AFP Paths in dhcp.conf
You will have to specify at least three paths in your dhcpd.conf - one for each
of the shared images, plus one for each client's private disk image.
These paths are specified in a somewhat complicated hexadecimal representation.
You may find "man ascii" useful. It makes things much easer if
you
can keep these paths short.
Here is an example path:
d4:f0:10:7:2:24:2:6E:62:0:0:0:0:2:6:73:68:0:68:64:31
Here is the same path tabulated with decimal and ASCII equivalents filled in where appropriate.
| HEX | D4 | F0 | 10 | 07 | 02 | 24 | 02 | 6E | 62 | 00 | 00 | 00 | 00 | 02 | 06 | 73 | 68 | 00 | 68 | 64 | 31 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| DEC | 212 | 240 | 16 | 7 | 2 | 36 | 2 | 6 | |||||||||||||
| ASC | n | b | s | h | h | d | 1 |
This breaks down as follows.
d4:f0:10:7 - this is the IP address of the server - in this case 212.240.16.7
2:24 - this is the TCP port number on the server - this is always 2:24
which is equivalent to 548
2 - this is the length in bytes of the following parameter
6E:62 - this is the name of the volume which the path points to - in
this case "nb"
0:0:0:0:2 - this is always the same
6 - this is the length in bytes of the following parameter
73:68:0:68:64:31 - this is the path and filename - in this case
"sh:hd1".
Path delimiters (":" on Mac; "/" on Unix;
"\"
on DOS are represented by Nul (Hex 0).
So this path points to a file called "hd1" in a folder called
"sh"
on a volume called "nb" on the server 212.240.16.7.
Note that paths are case sensitive!
I.e. hex 61 = ascii "a" <> hex 41 = ascii
"A".
Although hex 2d = hex 2D = ascii "-"
Security
to be done
It Doesn't Work!
Check your system log files and compare against the Basic Overview of Netbooting above. Try and work out at what point the process is going wrong. Try and fix it.
You can email me at ali@gwc.org.uk and I will try and help. I am likely to be less than sympathetic if you are having problems making Linux or Netatalk work. These are complicated products with their own support channels. If your problem lies elsewhere I will see what I can do.
Last modified 14 June, 2001. © Copyright ali@gwc.org.uk 2001.