[Casper] Computer Name is not populating when imaging

Smith, William william.smith at merrillcorp.com
Wed Nov 19 11:20:22 PST 2008


Hi Miles!

Great questions!

This method is definitely a workaround and not a solution. I left out some
details to shorten my post but I'll include them here.

Just the presence of the file isn't enough so a touch command to create the
preferences.plist file doesn't work. I do believe that a "defaults write"
command with the proper properties would suffice.

In my testing, the extra properties controlling the network interfaces,
location, etc., must be present for binding to work. I originally removed
all the properties in the preferences.plist file except for the one for the
Computer Name and Hostname. While the other properties were re-written by
the Mac OS they apparently weren't done either quickly enough or in the
correct order of events to allow my script to bind to Open Directory.

Querying the JSS for the Computer Name does not meet my needs in my
environment. We don't pre-populate or pre-stage machines. I need to be able
to specify the name in the Casper or Casper Imaging application.

Keep in mind that the same file with the cruft from the original computer is
still there with an OS image created by Composer. In my opinion, I haven't
created any more than would already be there.

My hope is that the JAMF folks make some changes to accommodate for InstaDMG
OS files. (I'm assuming defaults write to create the file with minimum
properties is the way to go.) They have an interest and desire to make
things work for their customers, which I appreciate greatly.

-- 

bill

William M. Smith, Technical Analyst
MCS IT
Merrill Communications, LLC
(651) 632-1492

On 11/19/08 11:40 AM, "Miles Leacy" <miles.leacy at themacadmin.com> wrote:

> Thanks for the info.
> 
> This does open up some more questions in search of a better solution...
> 
> The thought of manually building system configuration preferences takes the
> wind out of my automation sails, metaphorically speaking.  I don't like the
> idea of bringing over another machine's plist either.  It has potential for
> cruft, which we're trying to eliminate with InstaDMG, and it makes the
> assumption that we have a working machine to pull a plist from.  We probably
> do, but what if you're setting up a brand new site?  I'd rather be able to do
> this via scripting.
> 
> How does Apple Setup Assistant generate the
> /Library/Preferences/SystemConfiguration/preferences.plist file?  If it uses
> defaults, then we can deploy a plist that only contains the computer name and
> hostname keys, and let ASA handle the rest.
> 
> If the jamf binary can query the JSS, perhaps a script that gets the computer
> name and host name from the JSS, and then performs "defaults write
> /Volumes/yourtargetvolume/Library/Preferences/SystemConfiguration/preferences.
> plist <appropriate keys & values>" would be possible.
> 
> What if, as part of the InstaDMG process, you include a script that executes
> "touch 
> /Volumes/yourtargetvolume/Library/Preferences/SystemConfiguration/preferences.
> plist"?  Will the existence of an empty file allow Casper to set the
> preferences?
> 
> 
> On Wed, Nov 19, 2008 at 12:13 PM, Smith, William
> <william.smith at merrillcorp.com> wrote:
>> With the help of the folks at JAMF (thank you, Sam) I've created a simple
>> workaround to my problem.
>> 
>> The computer name is set by Casper at the end of imaging but before
>> rebooting to the imaged drive. At that point it is setting the Computer Name
>> and Hostname in:
>> 
>>     /Library/Preferences/SystemConfiguration/preferences.plist
>> 
>> This preferences.plist file does not exist in an InstaDMG image. It is
>> created by the Apple Setup Assistant, which has never run. Without the
>> presence of this file Casper cannot set the names.
>> 
>> Our workaround is to package the preferences.plist file from an existing
>> machine and include it during the imaging process.
>> 
>> Copying the plist file from my MacBook Pro to a PowerMac MDD G4 leads me to
>> believe this should work for most machines but I haven't tested any further.
>> 
>> The preferences.plist file also includes your Network Locations settings,
>> which location is active and your active network interfaces. Be sure to set
>> these prior to packaging.
>> 
>> On 11/11/08 4:37 PM, "Steve Wood" <swood at integerdallas.com> wrote:
>> 
>>> I am having the exact same problem and the good folks at JAMF are working on
>>> it.  So far we haven't been able to figure out why it is happening.
>>> 
>>> I have tried pushing just the image, without any extra apps or scripts, and
>>> I've tried it with the scripts and apps.  Both ways yield the same result.
>>> 
>>> To get around this, I've added to my post image script a piece that pulls
>>> the serial number of the machine and renames the machine to the serial
>>> number.  Not optimal, but it at least makes it easy to ID in ARD after
>>> imaging is done, and then I can go in and manually change it:
>>> 
>>> # rename computer to the serial number
>>> 
>>> NewName=`system_profiler | grep "Serial Number" | awk '{print $3}'`
>>> touch /$NewName
>>> #NewName='system_profiler SPHardwareDataType | grep Serial | awk '{print
>>> $3}''
>>> scutil --set ComputerName $NewName
>>> scutil --set LocalHostName $NewName
>>> scutil --set HostName $NewName
>>> 
>>> On 11/11/08 4:33 PM, "Smith, William" <william.smith at merrillcorp.com> wrote:
>>> 
>>>> Hi Folks!
>>>> 
>>>> I am testing InstaDMG as a means of creating our base Mac OS X 10.5 image.
>>>> Currently, I have it creating a fully patched 10.5.5 image and that image
>>>> is
>>>> in both our production Casper 5.13 system as well as our testing Casper
>>>> 6.01
>>>> system.
>>>> 
>>>> This 10.5.5 image is virgin until I install it with Casper. I am using a
>>>> combination of scripts and packages to add a local admin user, prevent the
>>>> setup assistant from appearing, set network preferences, time zone, etc.
>>>> 
>>>> When I image with either Casper 5.13 or Casper Imaging 6.01 I'm finding
>>>> that
>>>> the Computer Name is not getting populated in the Sharing preference pane.
>>>> It is completely blank. If I click the Edit... button to view the Local
>>>> Hostname it shows "Macintosh.local" instead of "MachineName.local".
>>>> 
>>>> Has anyone seen this behavior before? I've searched both the Composer and
>>>> Casper mailing list archives but neither returned results for InstaDMG.



More information about the Casper mailing list