AutoCasperNBI - open beta

bentoms
Release Candidate Programs Tester
Update: AutoCaspeNBI has been released, for more information see: https://macmule.com/autocaspernbi/

Hi All,

Over the past couple of months I've been working on an app that with streamline NetBoot creation for use with Casper Imaging (as well as creation of Read-Only DMGs to restore to USB sticks.. if that's your thing).

The basic idea is that you start with an clean never booted OS.dmg either from AutoDMG https://github.com/MagerValp/AutoDMG, Casper Admin http://macmule.com/2014/03/06/how-to-create-an-never-booted-os-dmg-using-casper-admin/ or a Composer captured OS.dmg from a never booted Mac (as in with forked builds).

Then add a copy of Casper Imaging, from there you can click build or amend the options on the first window or click the options button for more.

All the options should have popovers that explain their functions in a bit more detail. Most of the options set will be written to a plist (~/Library/Preferences/com.macmule.AutoCasperNBI.plist) will allows for AutoCasperNBI to be re-run when needed with the settings you haves used before.

external image link

You should see some blanks in the GUI & parts i've not added yet (due to the fact that I'm not sure how yet). These should be added at some point.

Then there will be a full 1.0 release & include:

  • Calculate space needed & alert if we do not have enough
  • Enable the "Additionals" tab. This will allow you to install pkgs to customise the .nbi further as well as additional JSS certs
  • Add some sort of sparkle updater
  • Add .jamfTarget creation
1 ACCEPTED SOLUTION

bentoms
Release Candidate Programs Tester

Hi All,

Thanks for the testing & thanks again to those whom attended my talk @ JNUC.

Slides & Links can be found at the following: https://macmule.com/2014/10/25/jnuc-2014-autocaspernbi-and-the-casper-netinstall-creator-session-sli...

View solution in original post

290 REPLIES 290

jescala
Contributor II

Great! Thanks! I'll test it in the lab the next chance I get.

MikeF
Contributor II

Great Work The old version worked great. I'll test this one asap. Thanks for all your hard work on this.

franton
Valued Contributor III

I tested your simple finder functionality. While it does hide any drive icons, it also stops launch pad showing any apps as well. I would suggest using some managed preferences to hide on screen drive icons instead of simple finder mode.

bentoms
Release Candidate Programs Tester

@franton yep. It seems to be a odd quirk of enabling simple finder.

I suppose I could remove LaunchPad from the dock?

Or swap the dock.plist if simple finder enabled.

jescala
Contributor II

@bentoms We use Simple Finder and launch Casper Imaging at login. I then have a folder in a hidden dock with the apps you include in LaunchPad. So you can do that, or if you prefer, hide items from the desktop as @franton suggests. My real concern is that I don't want to have a NetBoot image that makes it to easy to goof around. I especially don't want people to run Safari. So it would be nice if you can somehow hide, block, or remove unnecessary apps like that. It is your tool, so I leave it up to you. I hate to be picky when you've been so generous! Thanks!!

wilesd
New Contributor III

Firstly - Awesome app idea - Love it.

Question - How big of an image does this spit out? Does this delete all the rubbish (apps etc) not required for netboot to get the size down as far as possible?

franton
Valued Contributor III

The images i've been getting are about the 5Gb size. Perfectly acceptable for my own use case.

@bentoms Sorry Ben. Some want their images locked down, some (like me) need access to a few utilities in case of emergencies.

chris_kemp
Contributor III

@franton I agree, I also use the netboot image for other troubleshooting on occasion.

@bentoms looking forward to testing the new version - thanks again for this great tool!

bentoms
Release Candidate Programs Tester

Next commit will have a dock with just the Finder, Casper Imaging & Trash.

Once I get the additional installable pkg's option working (as shown under the advanced tab in the options window).. You can customise the dock as you wish.

@sovereign, as @franton mentioned.. I've added some reduction.. But haven't gone too mad. When NetBooting the client only pulls what it needs, so size is only really a factor when replicating NBI's or using USB sticks.

smith_kyle
New Contributor III

@bentoms I've been trying to setup a netboot image for 10.7 for my machines that only support that os, but no matter what image I pull, whether it's from an image I took with disk utility (tried both compressed and uncompressed), or AutoDMG, it always gives me "Cannot read OS Version." Any ideas? (10.7 is reported, right?)

smith_kyle
New Contributor III

Actually, just re-read some of this thread - do I need to run AutoCasperNBI on 10.7 in order to create the 10.7 NBI? I've been running AutoCasperNBI on 10.9 and trying to use a create one with a 10.7 image. Same as needing to run SIU on 10.7 to make a 10.7 image?

Thanks!

bentoms
Release Candidate Programs Tester

@smith.kyle, yep 10.7 - 10.10 NBI creation is supported.

Currently only supports being run on 10.7-10.9.

Is this being run on 10.10?

To get the OS version, AutoCasperNBI is is reading it from the SystemVersion.plist on /System/Library/CoreServices/

bentoms
Release Candidate Programs Tester

@smith.kyle, you do not need to be on the same OS version. :)

bentoms
Release Candidate Programs Tester

@smith.kyle, was this with 0.11 or 0.12 btw?

& was the OS.dmg already mounted?

smith_kyle
New Contributor III

Thanks! It was on 10.9 that I was trying to create the 10.7 nib with 0.12. I can't look at the server I as doing it on right now, but I believe the dmg was able to mount (think I saw that in the autocaspernbi log). Or do you mean I need to mount it ahead of time?

neilmartin83
Contributor II

@bentoms - Thank you for this, it's great and thanks for your support with the issue regarding spaces in the name and NetSUS. Got a couple of suggestions, just cosmetic really.

  • Is it possible to have the custom desktop image scaled so it isn't cropped etc when used with displays of differing resolutions?
  • Is it possible to hide the Untitled volume on the desktop? I'm guessing it's the ram disk used for shadow storage? (used the custom rc.netbot) - I can see people getting confused with it, assuming it's a USB stick or something.

neilmartin83
Contributor II

One thing I've noticed is that after imaging, when the system reboots, it hangs for a very long time, nearly an hour from what I've seen, before it actually reboots into the second stage.

This is with a reduced NetBoot Set that has ARD enabled and is using the custom rc.netboot.

I am going to try another without the custom rc.netboot but will leave ARD enabled and go from there...

Regards,

Neil.

bentoms
Release Candidate Programs Tester

@neil.martin83

Not sure about the desktop background. Only replace the DefaultDesktop.jpg with what you supply.

Desktop icons.. This has been brought up more than once, on a few commits I'll not set Finders settings so you can do as you need. (Once the optional to install additional packages is working).

As for the hang, is this a 10.9.4 NetBoot? https://jamfnation.jamfsoftware.com/30.0b6/30.0b6/discussion.html?id=11363

neilmartin83
Contributor II

@bentoms][/url ahh so it's likely to be a combination of 10.9.4/ARD. I'll generate a NetBoot set without ARD now and test tomorrow when I get in to work. :)

I've seen this behaviour on 3 different machines today. Interestingly they all eventually rebooted without my intervention but a significant amount of time was added to the imaging process.

Out of interest, do people tend to have the shadow storage in RAM rather than use a chunk of the server for it? Aside from the benefits of using less network bandwidth and server resources, are there any potential issues by doing it that way?

Reason I ask is that I come from a DeployStudio background and never had to deal with this when it came to using DS's own NetBoot sets. Ignorance was bliss. :)

Edit: does anyone know if this happens with VNC enabled rather than ARD?

Cheers,

Neil.

neilmartin83
Contributor II

It's me again!

After trying an NBI with ARD disabled, the system still hangs when trying to reboot just as it did before. This was observed on a late 2012 Mac Mini and Late 2012 iMac. I am going to assume it's something to do with Casper Imaging 9.31 and OS X 10.9.4 (AutoDMG generated). I'll try a 10.9.3 base image (AutoDMG generated).

I also noticed that the machine seems to pause the imaging process if not touched for a while, like it's gone to sleep. But I know it hasn't fully entered sleep, just the display has. If I put my ear to the Mac, I can hear the fan quietly spinning and the occasional hard disk churn. When I press a key the display quickly powers up again and I see Casper Imaging quickly 'rush' through a bunch of packages then it seems to carry on where it left off.

Regards,

Neil.

bentoms
Release Candidate Programs Tester

@neil.martin83 you're coming to the meet up tomorrow right?

If so, can we test some imaging remotely? To resolve i think we need to enable SSH & tail the system log at logout.

bentoms
Release Candidate Programs Tester

Updated to 0.13

—Resolved an issue calculating space on non-English language Macs.
—Added checkbox for hosting on NetSUS, this removes spaces from the NetBoot’s Name.

Same link as above

bentoms
Release Candidate Programs Tester

@smith.kyle Hi, AutoCasperNBI will error if it cannot mount the DMG (error showing as "Cannot Mount DMG", it will also error if it cannot read the OS version from:

set selectedOSdmgVersion to do shell script "/usr/bin/defaults read " & quoted form of selectedOSdmgMountPath & "/System/Library/CoreServices/SystemVersion.plist ProductVersion"

So as long as that plist exists it should be ok.

I've been trying to recreate the issue you're seeing, but am struggling.

neilmartin83
Contributor II

@bentoms Yes, happy to give it a go. Using AnyConnect on the iPad for VPN access and SSH is currently blocked - but can screen share to a second Mac on the network and do it through that. Loving Remotix by the way.

The build I'm testing with takes approx 40 mins to complete the first stage of imaging.

I finish work at 5 and am only down the road in Stratford so can get to St Paul's early if you like.

Will test a reduced 10.9.3 build this morning with ARD and custom rc.netboot enabled and report my findings.

neilmartin83
Contributor II

@bentoms][/url Ok... Tried 10.9.3 and observed:

  • On the Mini I had to give it a poke as imaging paused as if the machine went to sleep. The system hung when trying to restart, same as with 10.9.4. I was connected with ARD.
  • On the iMac, it didn't pause but did hang on reboot. I did NOT connect with ARD on this machine at all.

I'll go back to 10.9.4, image the Mini again, tail the system log and post results.

bentoms
Release Candidate Programs Tester

@neil.martin83.. right.. I had personally thought that the whole ARD thing was a bit of a red herring, what i've done on OSX server is clear the NetBootClients() folder, restarted the NetInstall service & re-NetBooted.

Not sure if you can do this with NetSUS of if starting the AFP/SMB service is enough.

neilmartin83
Contributor II

@bentoms Can't find any mention of that folder or shadow storage in general in the documentation (haven't SSH'd in yet to have a poke around the directory structure but I'd rather not as I'm not quite sure where to look and what to bash at).

This issue is consistent whether or not the custom rc.netboot is used... Also switching back to our original 10.9.3 NetBoot created the traditional way by @daz_dar works perfectly every time.

I'll have a system log for you shortly... just waiting for it to reboot, been hung a while now but stuff occasionally still appearing in the log. It'll finish soon...

Another observation with every one of AutoCasperNBI's sets is that there is a progress bar every time the system NetBoots, which I think is an fsck running.

neilmartin83
Contributor II

bentoms
Release Candidate Programs Tester

@neil.martin83, thanks for the link.

It appears to be the system.log from your mac & not the NBI's.

Anyways, the FSCK is not something I've seen.. & I'm wondering if this is all due to a bad upload?

I have seen the hang before, but that has been resolved my end. Possibly by uploading via a gig connection & not 100MB or wireless.

I know others have seen it, but it has also seemingly randomly been resolved.

Perhaps remove the image & re-upload?

neilmartin83
Contributor II

/url">@bentoms][/url Sorry I included some of my own logs by mistake when playing with the tail command, have edited the above post with the correct link now: [http://pastebin.com/2Q9hZ7qr

Have been uploading these via a gigabit link and have seen the same with each one, must have done quite a few by now so I don't think it's the network. Perhaps the NBI needs expanding with more free space? That's the one thing I haven't tried yet...

bentoms
Release Candidate Programs Tester

@neil.martin83 thanks for the logs, expansion is definitely worth a try.

The issue appears to be with kext's. (according to the system.log) as those were the last messages before the 30 minute delay at restart.

bentoms
Release Candidate Programs Tester

@neil.martin83 i've posted a fix in 0.14 that may help:

0.14
—?Added?touching?of?/System/Library/Extensions/?to?try?&?resolve?hang
on?reboot
—?Corrected?some?logging

If you have time, please try 0.14 & advise.

neilmartin83
Contributor II

@bentoms Thank you, will try it now.

neilmartin83
Contributor II

@bentoms Whilst waiting for the machine to finish first stage of imaging, I have a question.

Does AutoCasperNBI keep the disk image in the NetBoot Set mounted until you quit the application completely? If so that may be where I was going wrong with what looked like fdisk running at boot. I was copying the NetBoot set across before quitting the app. This time I quit the app completely and didn't see a progress bar when booting into the new set.

bentoms
Release Candidate Programs Tester

@neil.martin83, it wouldn't be AutoCasperNBI but NetSUS or NetBoot Server.

I'd advise copying the NBI, then restarting the NetBoot service or AFP/SMB then trying to boot.

neilmartin83
Contributor II

@bentoms - hung again :(

Also I think the Energy Saver preferences need tweaking as I had to hit a key to get the Mini to wake up properly again after it had paused during the imaging process.

Will try with a 20GB set next...

bentoms
Release Candidate Programs Tester

@neil.martin83, i did originally have a more "caffeinated" energy saver settings set, but removed them in favour of Apple's NBI defaults.

Let's have a talk about this later.

Thanks for all the help so far.

neilmartin83
Contributor II

@bentoms No problem, able to generate the NBIs faster now as am doing it on a server with a nice Pegasus R6. I think I've got time to try one more (same settings but expanded to 20GB) before I leave here - will restart SMB, AFP and NetBoot in the NetSUS.

Fingers crossed and looking forward to meeting you later. :)

neilmartin83
Contributor II

@bentoms Last one from me for today - not able to create an expanded NBI, got an error whilst creating dyld caches - here's a snipped from AutoCasperNBI's log:

Wed Sep 3 16:22:53 BST 2014 Trying to expand /Volumes/USS-RAID/Testing/10.9.4AutoCasperNBI.nbi/NetBoot.reduced.dmg to 24.4GB Wed Sep 3 16:22:53 BST 2014 Trying to mount: '/Volumes/USS-RAID/Testing/10.9.4AutoCasperNBI.nbi'/NetBoot.reduced.dmg Wed Sep 3 16:23:31 BST 2014 Mounted to: /Volumes/10.9.4AutoCasperNBI 1 Wed Sep 3 16:23:31 BST 2014 Trying to disable Spotlight Indexing on /Volumes/10.9.4AutoCasperNBI Wed Sep 3 16:23:32 BST 2014 Disabled Spotlight Indexing on /Volumes/10.9.4AutoCasperNBI Wed Sep 3 16:23:32 BST 2014 Creating dyld shared cache files on: /Volumes/10.9.4AutoCasperNBI Wed Sep 3 16:23:45 BST 2014 Error: Creating dyld shared cache files

See you in a while. :)

chisox1
New Contributor

Just grabbed it and made a 9.4 NBI, worked great! Nice work