Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.5: Install (or boot from) an image over local network Network
I needed to reinstall OS X, but my discs were broken. Fortunately, I had an image of the installation DVD on my server, so I figured that I should be able to boot into that image over the network. Well, it wasn't that easy.

In the end what you will need is a computer running two servers: one tftp server and one web or NFS server, preferably NFS, since you don't have to worry about making sure you have Apache 2 or newer to support huge file transfers over http. You'll also need some command-line skills, too.

The first step is to get four files:
  1. A bootloader
  2. A kernel
  3. An mkext file (which is a bunch of drivers)
  4. The image you wish to boot
All of these items are actually relatively easy to get. The first three are obtainable from inside a functioning OS X environment (or rather, an environment into which you, at the very least, can get a command-line). The bootloader is located at /usr » standalone » ppc » bootx.bootinfo. Copy it to your favorite place, i.e. a USB stick or something like that.

The kernel is located at /mach_kernel, just under the root directory. Copy that one, too.

The third one is a little bit trickier. It involves picking the drivers you'll need and putting them in a nice package. I'll give you a line to make life easier:
kextcache -L -N -S -Z -m mach_kernel.mkext /System/Library/Extensions
This will create a file named mach_kernel.mkext in the /System » Library » Extensions folder, which contains everything you need to successfully boot an image over the network. If you're curious about the flags, check out man kextcache. You really should also put this file on some kind of removable media, otherwise you may get stuck.

Now, take a deep breath, go make yourself some coffee, and treat yourself to a cookie, as the next two steps will be a little bit trickier if you're not used to fiddling with unix-like systems. You will need to install a tftp server and an NFS server on the machine you wish to boot from. I will not go through this as there are plenty of sources on the Internet to help with these tasks. Once you have these servers up and running, continue with with instructions.

What we want to do now is to fiddle around with the settings stored in the NVRAM (Non-Volatile Random Access Memory) of the Mac that you'd like to net boot. Don't worry -- it's relatively safe; there really is no way in which you might make your computer explode. We need to instruct the computer to boot in our special way. I'm simply going to give you a line, then I'll explain it:
sudo bless --netboot --booter tftp://bootx.bootinfo --kernel tftp://mach_kernel --options "rp=nfs:serverip:/directory:Image.dmg"
What we want to do is to use a special bootloader, load a kernel, and then mount the image. From the line of text you can probably guess which is which.

The tftp server serves as host for the bootloader, the kernel, and the kernel extensions. "But hey!" you might say, "I don't see the kernel extension on the line!", and you'd be perfectly right. It's loaded automatically based on what the kernel name is. In the line above, I have assumed that the bootloader, kernel, and kernel extension file are all located in the tftp's server root directory, but of course, they could be anywhere -- you'd just have to adjust the path on the line. The curious --options bit specifies options which are parsed by the bootloader to the kernel. We want the root partition to be loaded from an NFS share located at a certain IP adress, and at a certain directory. The colons (:) delimit the path from the filename.

You also might want to enable some verbosity (lots of text) at the next boot so you can see what's going on, in case anything goes wrong. Issue this command:
sudo nvram boot-args="-v"
So, what are you waiting for? Do it! This will change the boot settings the next time you start your Mac, so that's what we'll do. Reboot your Mac, hope and pray. If everything is alright, and we hope it is, your image will get loaded by the kernel.

To recap:

Your computer will load the bootloader, the kernel, and the kernel extension from the tftp server. If that goes well, the kernel will mount the image from the NFS server and continue the boot from it. I have to accredit two pages on the net which helped me vastly, namely: [robg adds: I haven't tested any of this one, and I suggest having good backups in place before experimenting with it.]
    •    
  • Currently 2.09 / 5
  You rated: 2 / 5 (11 votes cast)
 
[52,902 views]  

10.5: Install (or boot from) an image over local network | 7 comments | Create New Account
Click here to return to the '10.5: Install (or boot from) an image over local network' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Install (or boot from) an image over local network
Authored by: Dr. T on Mar 20, '09 09:31:52AM

Wouldn't it be simpler to burn a DVD from the disk image and install from the DVD? The dual network solution gets a high geek rating, but I vote for simple and reliable.



[ Reply to This | # ]
What about a Windows server?
Authored by: gabester on Mar 20, '09 10:33:52AM

It would be useful to me to be able to netboot a Mac from a Windows server; it seems like this is possible but I haven't the time to validate it nor have I heard about it being done.

Given this outline and the fact that the MacBook Air can be netbooted via Windows using Apple's own software it seems like it shouldn't require that much modification to boot another Mac via ethernet to a Windows PC.

I think, by discs broken, the author meant that the optical drives weren't reading. Who would break their Mac OS X DVD??



[ Reply to This | # ]
Problem with kextcache command
Authored by: gghose on Mar 20, '09 10:38:12AM

I've been looking for help in the regard for quite a while, but I'm having a problem with the kextcache command.

I continually get "archive would be too large; aborting"

Also, I assume your "-Z" flag should read "-z".



[ Reply to This | # ]
Problem with kextcache command
Authored by: blgrace on Oct 07, '09 10:11:31PM

I get the same error and unable to find an answer.
Just wondering if Extensions.mkext that is auto-generated would work?
There's also kernelcache.ADxxxx Blah inside /S/L/Caches/com.apple.kernelcaches/

???



[ Reply to This | # ]
Or use a Web Server
Authored by: allanmarcus on Mar 20, '09 11:23:22AM

If you image is on a Web server, just boot from the Install DVD, open Disk Utility, and use the Restore tab. Simply enter the URL into the Source box, drag the volume to restore to the destination box, hit the Erase Destination (will be much faster if you use Erase Destination).

Some assumptions:

1) You have DHCP in your network environment. The Install DVD can only get network if you have DHCP. We use small home routers (Like a DLink DI-604) to get DHCP where we don't have it.
2) You Web server needs to be able to serve a file as large as the image. You may need to tweak your apache conf file if you are using an older version of Apache.

Hope this helps.



[ Reply to This | # ]
10.5: Install (or boot from) an image over local network
Authored by: tom larkin on Mar 20, '09 01:10:35PM

From my understanding, and I was told this by a person at Apple, if you have a mounted disk image on a network share you can point the machine to netboot to it via the bless command. You must point it to the exact location of the mounted OS disk image on the network share via the bless command.

I have not used this method though so I can't verify. Nice hint though.



[ Reply to This | # ]
10.5: Install (or boot from) an image over local network
Authored by: bhushan.chopde on Mar 24, '09 09:59:12AM

HI! I tried Installing Leopard OSX for non-mac intel Based machines on a pentium 4 processor pc with ati radon X200 graphics card and 2 GB ram. But it restarts after installing!! What to do? can any1 tell me which combination of the settings to use?
Thanx in advance!



[ Reply to This | # ]