MoobyFR's blog

Some IT infos

Aller au menu | Aller à la recherche

OSX: what is Netboot and using it with linux

, 05:44 - Lien permanent

Netboot is a technology created by Apple to boot computers on the network like PXE. OSX Server integrates a daemon for this service. It uses a extension of DHCP, known as Boot Service Discovery Protocol BSDP

Understanding Netboot

Technically the Netboot is really easy to integrate in a network, where other services are already deployed. Netboot itself only send DHCP Inform messages with adapted content.

So a basic workflow of a boot is as follow:

  • The client: DHCP DISCOVER
  • The DHCP server's: DHCP OFFER
  • The client: DHCP REQUEST
  • The DHCP server's: DHCP ACK
  • The client: DHCP INFORM LIST
  • The BSDP server's: DHCP ACK LIST
  • The client: DHCP INFORM SELECT
  • The BSDP server: DHCP ACK SELECT

The LIST/SELECT allows to choose the disk image to transfer.

The next step is to bootstrap the system. The BSDP send a bootstrap code "booter" through tftp. This code will load the system through the network, depending on the NetBoot creation. This is usual NFS(fast) or HTTP. The content from the image is run.

Netboot image, what's in ?

A netboot image has a .nbi suffix. In OSX, this is displayed as a bundle, but it has a directory structure Capture_d_ecran_2014-04-29_a_08.35.00.png

When you are serving a nbi file for BSDP, the bootstrap file is i386/booter. The DMG file is the main image which will be server with NFS or http. The two other interesting files are i386/PlatformSupport.plist and NBImageInfo.plist . They are xml files, you can edit them direly with vi

They contains, for example, which hardware the image support. In OSX, always use the latest hardware as reference. EnabledSystemIdentifiers and DisabledSystemIdentifiers references them.

Netboot image creation

My main interest is to deploy massively OSX. This let me to look into BSDP and DeployStudio. The DeployStudio features several tools

  • DeployStudio Server, which is responsible for sending to clients
  • DeployStudio Runtime which is a client to connect to the DeployStudio Server
  • DeployStudio Assistant, which permit to:
    • Set up The Server
    • Create Netboot Image
    • Other possibilities..

The "Create Netboot Image" is the way to make the nbi file. it will add the runtime (and some other things into the image.

How to deploy ?

Now you know hot to create nbi files, what's in, and how should things go. You have probably already a DHCP server, you are missing the BSDP service ? no need to buy a OSX server only for this purpose. There is BSDPy, a server written in python which will do the job of serving the specific part of BSDP:

Services needed

  • A working DHCP server, serving a IP on request (no option needed)
  • A working TFTP server
  • A HTTP ou NFS accessible share
  • Install the BSDPy and the required library.
  • Move your Netboot image in the tftp directory

If you follow bruienne's wiki, you will end up in a /nbi directory , containing a subdirectory DSR-1085.nbi.

  • Verify you can get the file /nbi/DSR-1085.nbi/i386/booter through tftp
  • Set up NFS or apache to be able to server nfs://f.q.d.n/DSR-1085.nbi/ or http://f.q.d.n/DSR-1085.nbi/
  • Start the server with -r http -p /nbi/DSR-1085.nbi/

You'll get logs into /var/log/bsdpserver.log

DEBUG: Considering NBI source at /nbi/DSR-1085.nbi
DEBUG: [========= Using the following boot images =========]
DEBUG: /nbi/DSR-1085.nbi
DEBUG: [=========     End boot image listing      =========]
DEBUG: Determining image list for system ID VMware7,1
DEBUG: Found enabled system ID VMware7,1 - adding "DSR-1085" to list
DEBUG: Found default image ID 1085
DEBUG: -=========================================-
DEBUG: Return ACK[LIST] to on 68
DEBUG: Default boot image ID: [129, 0, 4, 61]
DEBUG: -=========================================-
DEBUG: Determining image list for system ID VMware7,1
DEBUG: Found enabled system ID VMware7,1 - adding "DSR-1085" to list
DEBUG: Found default image ID 1085
DEBUG: -->> Using HTTP URI:
DEBUG: ACK[SELECT] image ID: [129, 0, 4, 61]
DEBUG: -=========================================-
DEBUG: Return ACK[SELECT] to on 68
DEBUG: TFTP path: /nbi/DSR-1085.nbi/i386/booter

So the client had bootstrapped and loaded the image through HTTP. Using BSDPy was the only addition to be able to netboot a Mac Client. This has permitted to deploy successfully a workflow from DeployStudio, and a full installation from OSX Maverick with a NetImage