Casper Imaging 8.6 Not Naming Computer

ernstcs
Contributor III

Casper Version 8.6
Mountain Lion

Although I have specified the computer name in the field for Casper Imaging and updated the information on the JSS with the checkmark as well, after imaging a system I notice that the computer has no name, all I get is localhost. Anyone else seen this issue?

1 ACCEPTED SOLUTION

ernstcs
Contributor III

As I understand it, there may be hope in the next version of the Casper Suite to put this issue to rest...for now. In the mean time, although you all have some wonderful ways of doing this, I went an even more different route since I bind to AD and that part of the FirstRun works every time since the bind script in FirstRun uses the name in the script. =D

It's probably a terrible way to do it, but I read the computer name out of the AD settings at whatever point works and then pass that through to scutil. I found it more reliable to have a simple script part of first run that calls a custom triggered policy. The policy it calls installs a self-deleting StartupItem with the script below. After FirstRun finishes and reboots, the StartupItem runs and does the rest and then cleans itself up. You wouldn't need to output it to a file like I do, that I use for later reboots where another StartupItem renames the computers back to what they were when they were imaged to maintain the same name, you know the stupid (1) and (2) after the names, etc. I run another enroll command to make sure it does, that's been spotty as hell, too.

TEST TEST TEST, and if you have any questions, let me know. Thanks for all the responses folks!

YOU MUST CHANGE your plist file name, since it won't be UWEC like mine. Also, if you have a preference on computer name case, you'll have to work around that, too.

#!/bin/sh

## Delete an existing computername.conf file if it already exists
if [ -f /private/var/computername.conf ]; then

    /bin/rm /private/var/computername.conf
fi

## Create new computername.conf file using AD binding information, and then set the computer name
if [ -f /Library/Preferences/OpenDirectory/Configurations/Active Directory/UWEC.plist ]; then

    defaults read /Library/Preferences/OpenDirectory/Configurations/Active Directory/UWEC.plist trustaccount | sed '$s/.$//' > /private/var/computername.conf

    set_name=`/bin/cat /private/var/computername.conf`

    /usr/sbin/scutil --set ComputerName $set_name

    /usr/sbin/scutil --set LocalHostName $set_name

   jamf enroll
fi

View solution in original post

119 REPLIES 119

GabeShack
Valued Contributor III

EDIT:The below used to be true but now looks like you may need to remove /Library/Preferences/SystemConfiguration/preferences.plist after you target this machine to another to capture it (as it will recreate this file each time you reboot).

Original Post (may not still be correct in 8.64)
Did you remove the system configurations folder from the machine? Since Casper Imaging uses the preferences in this folder to write the name, if its been removed the naming will only create localhost or blank.

You may need to rebuild your base image and leave the system configuration folder in place.

/Library/Preferences/SystemConfiguration is the path.

Gabe Shackney
Princeton Public Schools

Gabe Shackney
Princeton Public Schools

eculp
New Contributor

Are you using PreStage Imaging in Casper? If you are, you can add the computer name(s) there. It works slick.
I imaged 450+ computers and they all had the name applied.

ernstcs
Contributor III

The SystemConfiguration folder is intact.

We do not use PreStage imaging here. I'm guessing that would not help though, if naming the system right in Casper Imaging can't do it I imaging the same would occur when it tries to pull it from the JSS automatically during prestage imaging.

gachowski
Valued Contributor II

Yes, I have see this. I had to create a rename script and bind at AD script to solve the issue. I was also seeing super long names generated by our DNS. At reboot I reset the name and then rebind to AD. Same a Casper does/did but I just bind to AD last. I control the order of the process, buy the names of the scripts

I do not delete /Library/Preferences/SystemConfiguration in X.8 however I was in X.7 as there was a bug with network ports.

I use a pre-stage set up

ernstcs
Contributor III

This is for sure an issue with just 10.8. I tried two different systems and they both do it, can't name the box for 10.8, but name it just fine with 10.7. I shouldn't have to create a script to get around this.

Performing these commands after the fact work of course and just leads me to believe it's a bug in imaging, but I figured a bunch more people would have noticed it and posted already, or just the opposite and said they've imaged ML with proper naming just fine.

/usr/sbin/scutil --set ComputerName <name>

/usr/sbin/scutil --set LocalHostName <name>

CFountain
New Contributor

I'm also having the exact same issue. I've imaged almost 130 Macs to OS X 10.8 with Casper 8.6 and only one has renamed sucessfully. But because school is starting back very soon, I have not had the time to troubleshoot the issue.

Also the computers will bind to AD with the name "no name". Which I found rather amusing.

ernstcs
Contributor III

I put in a support call on Friday for this, and I'll post what I get back for information.

matthew-c
New Contributor III

Seeing this as well, on 10.7.

Am going to try and narrow down exactly when it does happen.

Matt

plawrence
Contributor II

Are you all just using plain text computer names? Are there any special characters like hyphens, underscores or spaces?

I'm testing imaging a 10.8 client here and am having no trouble renaming it or binding it to AD.

Patrick

ernstcs
Contributor III

Both cases. I've tested on a system that has a hyphen in the name, and one that just has letters and numbers.

MAC-OL1108-SP1
LTS2653531x

ernstcs
Contributor III

Patrick,

What is your imaging partition setup look like? Are you imaging from a partition that's 10.8, logged in as root or another user, are you using netboot, netinstall? What's the details of your imaging process.

Right now I'm on a separate partition with 10.8 running as root imaging. Wasn't sure if the issue was in where people are imaging from.

Chris_Hafner
Valued Contributor II

I'll jump on the band wagon here. I'm experiencing the very same issue (v8.6 and 10.8). Everything imaged to 10.7 or below names just fine. Anything imaged to 10.8 simply doesn't get named and proceeds to identify itself as localhost. Naming them via JSS and letting my inventory process rename the unit has only met with mixed results. Unfortunately, I've not yet been able to analyze the issue as I've been under a tremendous work load. I'm really glad this discussion came up. I was half way through starting one on friday but got caught up and didn't want to get one going without more results. Fortunately for me it's not dire, but severely inconvenient.

When we name units they are named in the following manner
BA-Department-FirstName LastName

plawrence
Contributor II

Craig

I'm imaging from a NetBoot set, which is running 10.8 and casper imaging 8.6. The NetBoot set logs in as root.

CFountain
New Contributor

My NetBoot image is also running Mac OS X 10.8 and Casper Imaging 8.6. It Auto-logs as root.

Chris_Hafner
Valued Contributor II

Ditto

mark_sampers
Contributor

We are seeing the same (non-naming) when deploying a 10.8 base though our set-up is different. Our NetBoot image is running OS 10.7.4 and using Casper Imaging 8.52. It Auto-logs in as root.

rockpapergoat
Contributor III

pretty much the same thing here with a 10.8 net boot set + 8.6 tools installed on it.

10.8 machines fail to set the hostname. 10.7.x may fail also, though i'd have to check.

in my case, i'm installing 10.8 via a pkg, so i don't necessarily expect the machines to set their names on the actual first boot. i do kick off a first boot routine after the 10.8 install that should mimic the standard jamf stuff, though.

thomasC
Contributor

JSS 8.6 10.8 NetBoot
10.8 Image
Name gets wiped. ---
No issue with 10.7 NetBoot 10.7.4 Image
10.6.8 Image
---
Anyone contact JAMF?

ernstcs
Contributor III

Yes, I have a support call in for it. Likely a defect to come. I will keep you all posted.

ernstcs
Contributor III

From JAMF:

Hello. I have spoke with development regarding this issue as we have seen it at times in our environment as well. This is an issue with the contents of the:

/Library/Preferences/SystemConfiguration/preferences.plist

following a reboot after laying down an image.

Though the preferences.plist is properly configured with the name we set prior to a reboot, when we boot to that partition at some point the preferences.plist is converted to mangled data thus reverting the name to localhost. This appears to be an Apple issue and we have filed a Radar defect with Apple regarding this error.

We encourage you to inform jamfnation if you would like, as well as file a radar defect of your own. To see the issue we can image, and not select to reboot, at that point you can check out the preferences.plist, and after reboot check it out once again. We have seen that prior to a reboot the .plist will be configured properly by Casper, but the reboot causes a mangling for some reason.

rtregaskis
New Contributor

Have same issue in our new environment. Opting to peruse with 8.6 and not re-image as currently expecting new macs with 10.8 arriving we just enrol as part as a pre-imaginging config. However, we are also seeing the Department and Building attributes from the configuration not being set either? Anyone else?

thomasC
Contributor

In testing I haven't found an issue imaging with the following.
-----
JSS 8.6 NBI 10.8 Casper Imaging.app 8.5.2 OS 10.8 in configuration
-----
Spotlight - works Computer Name - as entered during imaging.
LocalHostName - is set to ComputerName as expected
HostName - not set
Note: system was not in JSS prior to imaging
-----
Need to talk to JAMF and see if this has been tested and could be a work around.

Anyone else try this?

Chris_Hafner
Valued Contributor II

I'm on Casper imaging 8.6 unfortunately. Though, I've suspected the imaging app from the beginning.

EDIT--- see post below.

Chris_Hafner
Valued Contributor II

I just tried making a netboot image using the above configuration.
JSS 8.6 NBI 10.8 Casper Imaging.app 8.5.2 OS 10.8 in configuration

However, the units are still not being named. I've tried with units that are not in the JSS and units that are. Unit's that I've deleted and units that I've named in the JSS inventory specifically to see if the inventory process would re-name it after. What I discovered was that, at least with 8.5.2 imaging it actually removed the name from the inventory!

This is a serious issue for us as I will be pre-staging almost 500 computers in two weeks and I only get one day to do it. Easy enough, but having to sort out the names is really going to burn my rear.

tkimpton
Valued Contributor II

Really not happy started going a bit nuts at Thursby thinking their new ADmitMac 7 was at fault! Now I'm thinking it damn Casper 8.6!

This indeed annoying as my machines won't bind to AD!

ernstcs
Contributor III

I just tried imaging a system with 10.8.1 with Casper 8.6, a system that was consistently not naming after imaging, and now it is. =D

ooshnoo
Valued Contributor

ernstcs

I tried imaging a system with 10.8.1 and it still isn't naming for me. The name is blank and the AD bind is set to "no name"

Nice.

Did they ever respond to your question?

ernstcs
Contributor III

Not sure what to say there. Pretty sure JAMF was going to test again with a system(s) they've been unable to name. I was trying to figure out if it was somehow hardware specific, but that's been difficult. I guess we keep plugging away and see what else comes up.

I patched my existing 10.8 build created on a 15" MBP Retina running the softwareupdate -i -a command. I do standard Composer OS images. Although, I didn't patch on the MBP, I made the updated image on the iMac I've been having issues on. Perhaps I'll grab another of those iMacs tomorrow.

These issues are the worst. Some people see it and others don't. Someone sees Self Service crash. Others don't. Lots of variables on how you made your images, etc.

Chris_Hafner
Valued Contributor II

After running more tests with the following
jss 8.6
netboot 10.8
Casper Imaging 8.6
OS being imaged 10.8.1
one computer had a name already in the JSS inventory and one did not. Neither were named. The one that already had the name, had it removed in JSS' inventory.

no name... right now I'm about to upgrade my netboot image to 10.8.1 and cross my fingers.

FastGM3
Contributor

Well I thought it was fixed as well after upgrading to 10.8.1 but here's what I'm finding out, at least in my case.

If I create the image on a Retina, the naming works fine on the Retina but the naming doesn't work on a MacBook Pro.

If I create the image on the MacBook Pro, the naming works fine on the MBP but not the Retina!

UGH,
Anyone else want to double check this?

tkimpton
Valued Contributor II

This is my workaround

All my machines have the HDD Volume to match the computername and start with LDN

#!/bin/bash

### INTRO ###
# 10.8 bug where machine name doesn't get applied. This script gets the volume name starting with LDN and makes sure it is the computername

### VARIABLES ###

# Make sure the config file exists
touch /Library/Management/Scripts/computername.conf

# Write to the config file
volume=`ls /Volumes/ | grep LDN  > /Library/Management/Scripts/computername.conf `

### DO NOT MODIFY BELOW ###

# Compare what is in the computername.conf to the current computername and if they do not match it will change it

current_computername=` /usr/sbin/networksetup -getcomputername`

set_name=` /bin/cat /Library/Management/Scripts/computername.conf`

# Now to compare both of the strings
if [[ $current_computername = $set_name ]]

then echo "All looks good, computer name checks good"

else /usr/sbin/networksetup -setcomputername $set_name
scutil --set ComputerName $set_name
scutil --set HostName $set_name
scutil --set LocalHostName $set_name
fi

exit 0

I then package up and deploy the script in the build along with a launch daemon to run it.

Chris_Hafner
Valued Contributor II

@FastGM3

The image I tested earlier were based on 2011 MacBoo Pro's being imaged back onto 2011 MacBook Pro's Still no name. right now I've updated my NBI to run 10.8.1 itself and I'm crossing my fingers.

nkalister
Valued Contributor

how are you guys creating your images? Composer captures, modular Casper Imaging images based on the InstallESD.dmg file, instaDMG, or ?

ernstcs
Contributor III

The fix for this problem is beyond me and probably my pay grade and competence.

Based on my testing today here are my results:
Casper Suite 8.6
Imaging from OS 10.8 (regular OS images that logs in as root, not netboot or netinstall)
Applied OS images Mountain Lion 10.8 or 10.8.1 (10.8.2 beta not tested)
Using Composer or Disk Utility to create the OS DMGs

In my opinion this issue is hardware bound, meaning that computer naming will work fine on the same model hardware the Composer or Disk Utility OS image is created on. I found this to be true when working between two iMacs of the same model.

In testing I would take an existing OS DMG that would have machine naming break after Casper Imaging, on that same machine take that same OS DMG and apply it via Disk Utility, boot to that partition and not even login (but I did have to boot to it at least once, if not it still broke, the OS is doing some of its own magic here apparently when it first boots), reboot to my imaging partition, simply run that partition through Composer to generate a new OS image, and using that with Casper Imaging now makes computer naming work for that same hardware, and then not others including the one the original image came from.

So the simple act of running that partition through Composer to build an OS image on the particular hardware model you want to work, will. SO in theory you could have a separate OS image per model for the time being, but the renaming methods folks have put together are your most sensible option if you tested them to work.

In my opinion this is up to JAMF and Apple to sort out unless you have lots of free time and the know how I lack to troubleshoot it further. Even when I apply the OS image from one model to the other with just Disk Utility there is no name, but there is with the same model, which to me suggests it's not even something JAMF has done with Composer or Casper Imaging.

Testing with beta on Monday as I'm sure it's still an issue there, and will submit a bug report.

Olivier
New Contributor II

I also had this issue, and I lost my hair during 2 weeks to fix it.

Let me share my experience :

- We use a modular image approach. We boot on a NetBoot image or use a USB disk to deploy the image and other packages to internal Mac HDD.
- We build a Composer image on a MacBook Air, and try to deploy it on MacBook Air, MacBook Pro and other Mac hardwares.
- CasperImaging had some problems to set the computer name : it was also blank and obviously, domain join failed or name was, as many said, localhost.

In fact, I don't think Casper is the problem as it relies on underlying stuff (I suppose something like scutil, but scutil cannot be use, AFAIK, to set computer name on a partition which were you are not currently booted on.

The mystery remains in /Library/Preferences/SystemConfiguration/preferences.plist as one said.

Imagine there is an existing "Sets" entry in the plist (the "Sets" seems to be bound to the hardware type), and you change the hardware (happens in case you use a modular image, and target machine is not the same type as original machine). Before you reboot, the computer name resides in System:System:ComputerName and System:Network:HostNames:LocalHostNames key.

After you reboot, OSX moves the whole tree subset to "name of the previous hardware":System:System:ComputerName and "name of the previous hardware":System:Network:HostNames:LocalHostNames key.

In my case when I boot the MacBookPro, it moved the tree to MacBookAir4,2:System:System:ComputerName and unfortunately, leaves the proper System:System:ComputerName non-existent, resulting in empty computer name.

In some cases (sorry don't remember when), the OSX image I put on the internal disk gets the computer name of the USB disk under the one I booted previously and which is still connected : OSX is so smart that it gets the computer name from /Volumes/myusbdisk/Library/Preferences/SystemConfiguration/com.apple.smb.server.plist located on my USB disk, and re-use it to populate the /Library/Preferences/SystemConfiguration/preferences.plist.

So here what I did :

Create a PKG file executed immediately after you perform your block copy and before computer name is set by Casper. This is because scripts will be executed "after the fact" and I am too lazy to spend my time fixing stuff after it is too corrupted or after first reboot.

In this PKG, only create a postinstall script with commands :

defaults delete "$2/Library/Preferences/SystemConfiguration/preferences" NetworkServices
defaults delete "$2/Library/Preferences/SystemConfiguration/preferences" CurrentSet
defaults delete "$2/Library/Preferences/SystemConfiguration/preferences" Sets
defaults delete "$2/Library/Preferences/SystemConfiguration/preferences" Model
rm "$2/Library/Preferences/SystemConfiguration/com.apple.smb.server.plist"

I thought at the beginning to delete the whole preferences.plist file from my main DMG file, or delete it with the PKG and method above, but it does not work well in some cases (don't remember why again, maybe in case there are USB disks still connected to the computer with com.apple.smb.server.plist file).

For me, the behavior is clearly not the same as in 10.7, so Apple must have changed something.

Chris_Hafner
Valued Contributor II

I don't know if anyone else is experiencing the following additional naming issue. I have several units (Imaged as mentioned above) to 10.8 who are not taking the newly assigned name from the JSS inventory. The computer name recorded in the JSS record actually get's wiped and replaced the localhost(). Any thoughts there? I'm a week from D-Day and hope that Apple releases 10.8.2... I'm also hoping that this fixes the issue.

EDIT! Never mind... there was some cross imaging. Nothing in the JSS is losing it's name. Sorry if I got anyone going!

ernstcs
Contributor III

That would be normal after imaging. localhost is what the OS is naming the system when there is no name provided or set properly. After imaging runs and it does its initial recon it would normally update the computer name in the JSS to the same, which is localhost.

There is currently no setting in the JSS (shakes fist at JAMF) to always retain the computer name that's in the JSS and force it onto the clients to FIX them when they recon. Some of us get around that by other means of course.

Chris_Hafner
Valued Contributor II

Quite correct. However, we simply name them after imaging/recon and set the computer name along with the daily inventory. I goofed and through some hectic testing while moving offices thought that names were changing back to localhost post recon/imaging. I was however, quite wrong.

Unfortunately it doesn't look like Apples recognizing the problem quite yet. I'm prepping our LDAP to handle our naming this time around. Not happy about it, but it works.

Chris_Hafner
Valued Contributor II

Any update on this issue?