Home > Bash scripting, Mac administration, Mac OS X > NetBooting across subnets

NetBooting across subnets

Being able to NetBoot from a server that’s not located on the same subnet as the Mac you’re working on can be an invaluable tool for a Mac admin. I use NetBoot all the time at my shop, both to boot new machines for setup by DeployStudio and also to boot ailing machines from NetBoot-hosted utility disks.

In my case, our network team configured our network infrastructure in order to allow my machines to NetBoot from a server located on a different subnet (in my case, the server’s located in our main datacenter.) However, not everyone has that option available. If you’re one of those folks, here’s the commands you can use to configure your Mac to boot from a specific NetBoot server located outside of the local network.

Short version:


sudo bless --netboot --server bsdp://ip.address.here

This command should (hopefully) tell your Mac to boot from the default NetBoot set available from that NetBoot server.

Long version (should all be one line):


sudo bless --netboot --booter tftp://ip.address.here/NetBoot/NetBootSP0/NetBoot-Set-Name-Here.nbi/i386/booter --kernel tftp://ip.address.here/NetBoot/NetBootSP0/NetBoot-Set-Name-Here.nbi/i386/mach.macosx --kernelcache tftp://ip.address.here/NetBoot/NetBootSP0/NetBoot-Set-Name-Here.nbi/i386/x86_64/kernelcache --options "rp=nfs:ip.address.here:/private/tftpboot/NetBoot/NetBootSP0:NetBoot-Set-Name-Here.nbi/NetInstall.sparseimage"

This should work if the previous command did not, though you’ll need to know the specific NetBoot set’s name.

Hat tip to @gmarnin for posting this and also to @natewalck for helping figure it out.

  1. Daniel Hoit
    January 2, 2012 at 6:03 pm

    Rich,
    I’m pretty sure the –kernel flag is for 10.6.x and before, while –kernelcache is for 10.7. I think this is a change in the way Lion builds net boot sets. Using both shouldn’t be possible, since the <10.7 images don't have a file named kernelcache, while the 10.7 sets don't have a mach.macosx file.
    Also note that you can use http hosted images with the extended syntax as well (rp=http…). The nice thing about that is your kernel/cache and booter can live on whatever server is running tftp, while the images can sit on another server running http. This allows for super easy load balancing.
    I wrote an app to read all this from a web service, and allow machines to be set to net boot without the need for bsdp and had to update it when 10.7 came along and threw its new wrinkles in.

  2. anon
    July 23, 2012 at 3:11 am

    This is an old thread but are you having issues with tftp based netboot across subets on the newer i-series mac hardware? local network imaging works fine.

  3. October 17, 2012 at 1:41 pm

    I revisited this recently and found the following to be true:

    1. For 10.8.2 Netboot sets, mach.macosx does not exist. You can and should leave out the –kernel option since it is pointing to an non-existent file.

    2. I’ve see some machines fail pointing it to NetInstall.sparseimage. I’ve changed it to NetInstall.dmg and it seems to work more reliably that way.

    Nate

  4. jesse@servicemacs.com
    October 25, 2012 at 2:28 pm

    You think this would work across the internet, if port forward and firewall were open correctly?

    • joe blow
      December 14, 2012 at 7:07 pm

      WAN yes. You really do not want to tftp across the internet unless you like unfettered access to your or the endpoints network.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 159 other followers

%d bloggers like this: