Home Forums Software InstaDMG Loginwindow, AdminHostInfo, Name & Password, Custom Desktop Picture

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #372184
    Patrick Fergus
    Participant

    I’m builiding our utility NetBoot image with InstaDMG. This is the image we use primarily for machine building and repair. I’ve included the following in a postflight in a CustomPKG:

    [code]#Set the login window to show the IP address of the machine
    /usr/bin/defaults write $3/Library/Preferences/com.apple.loginwindow AdminHostInfo IPAddress

    #Set the login window to name and password
    /usr/bin/defaults write $3/Library/Preferences/com.apple.loginwindow SHOWFULLNAME -bool true

    #Set the desktop picture behind the Loginwindow
    /usr/bin/defaults write $3/Library/Preferences/com.apple.loginwindow DesktopPicture “/Library/Desktop Pictures/NetBoot_Loginwindow_Desktop.jpg”[/code]

    However, when I start up the computer (from an imaged hard drive) the three items above are not set–the login window text is “Mac OS X 10.5.2”, the login window is in “list of users” format, and the desktop picture is the aurora. If I start up and:

    – Forcibly reboot via a UNIX script (“reboot” as root via ARD), the problem is not fixed
    – Log in and log back out, everything is fine.
    – Log in and forcibly reboot via a UNIX script (“reboot” as root via ARD), everything is fine

    Thoughts?

    – Patrick

    #372191
    Patrick Fergus
    Participant

    So far, I’ve:

    – Changed the login window to name and password by yanking my local admin account off of the image. We’ve been using root for the last few years to avoid permissions issues when they’re least needed in an emergency.

    – Changed the desktop picture by replacing /System/Library/CoreServices/DefaultDesktop.jpg . A bit distasteful to be changing items in there, but dropping a JPEG into /System/Library/CoreServices isn’t going to kill anyone.

    – Planning on trying the following command for the IP address information (via a CustomPKG):

    [code]/usr/bin/dscl -f $3/var/db/dslocal/nodes/Default localonly -mcxset /Computers/localhost com.apple.loginwindow AdminHostInfo always 0 IPAddress[/code]

    I’m not sure about one thing–will “localhost” survive being NetBooted on various machines? I’d prefer to not get caught by a MAC address crawling in there.

    Thanks,

    – Patrick

    #372200
    knowmad
    Participant

    please tell us how well the mcxset command works

    #372210
    Patrick Fergus
    Participant

    mcxset is Apple’s command-line tool to create MCX policy. Apple’s GUI tool to create MCX policy is WorkGroup Manager. A possible usage is covered here:

    [url]https://www.afp548.com/article.php?story=using-mcx-in-the-dslocal-domain[/url]

    – Patrick

    #372236
    knowmad
    Participant

    [QUOTE][u]Quote by: knowmad[/u][p]please tell us how well the mcxset command works[/p][/QUOTE]

    ahem… I meant … ‘please tell us how the MCXSET command works… out for you…. ie how good or bad an answer it is to your specific issues’

    but the pointer to the info on how it works is well appreciated too!

    #372241
    Patrick Fergus
    Participant

    I actually am learning as I go regarding mcxset. I don’t have any better resources than you could find with Google. Sorry.

    – Patrick

    #372242
    Patrick Fergus
    Participant

    Regarding my issue with the IP address in the login window, here’s the full rundown of what I did:

    Joel’s suggestion #1 (binding to a directory and having the setting set by policy) is something I’d rather not do since I’d rather not have this image depend on any external directories to set itself up. Suggestion #3 (using mcxquery) won’t work with my original attempt to set AdminHostInfo since I was directly setting it in /Library/Preferences/com.apple.loginwindow.plist via defaults.

    Suggestion #2 (local MCX) caught my attention. I wrote/borrowed a script to set the MCX settings at startup:

    [code]/usr/bin/dscl . -create /Computers/localhost
    /usr/bin/dscl . -create /Computers/localhost RealName localhost
    /usr/bin/dscl . -create /Computers/localhost GeneratedUUID $(/usr/bin/uuidgen)
    /usr/bin/dscl . -create /Computers/localhost ENetAddress $(/sbin/ifconfig en0 | /usr/bin/grep ether | /usr/bin/awk ‘{print $2}’)
    /usr/bin/dscl . -create /Computers/localhost IPAddress 127.0.0.1
    /usr/bin/dscl . -mcxset /Computers/localhost com.apple.loginwindow AdminHostInfo always IPAddress
    /usr/bin/killall loginwindow[/code]

    It suffered from the same issue as setting this via defaults–the initial startup did [i]not[/i] have the IP address in the login window, while logging in and logging out caused the IP address to appear. Since I was building a NetBoot image, I would also have to work around the ENetAddress entry in the above information. However, if I could get the same setting into the [i]guest[/i] computer account it should work without tweaking the MAC address. At this point I used some of the information from this article:

    MCX, dslocal, and Leopard

    and did the following:

    1. Opened Workgroup Manager and connected to Address: “localhost” using the local admin’s username and password.
    2. Ignored the warning that I was working in a local directory node
    3. From the “Server” menu, selected “Create Guest Computer”
    4. Switched to viewing “computers” in the left hand column
    5. Clicked “Preferences” in the toolbar
    6. Ignored the warning that I was working in a local directory node
    7. Selected “guest” from the left hand column
    8. Clicked the “Login” preferences
    9. Set “Manage:” to “Always”
    10. Set “Heading:” to “IP Address” and “Style:” to “Name and password text fields”
    11. Clicked “Apply Now”
    12. Quit WorkGroup manager

    I copied the following file:

    [code]/private/var/db/dslocal/nodes/Default/computers/guest.plist[/code]

    to the same place on a freshly imaged partition. Upon restart, the IP address appeared correctly in the login window. I’m now rolling that file into my InstaDMG image and will report back.

    – Patrick

    #374555
    christern
    Participant

    Hi Patrick and others in this tread
    How is the end of this story? Success?

    /christer

    #374556
    Patrick Fergus
    Participant

    IIRC (not at work), dropping in guest.plist works fine. You do get a hunk of errors in system.log complaining about not being able to synthesize the “guest” record since there already is one, but it does work. Since we’re doing this for a NetBoot image where the shadow (temporary) space is thrown away at restart, I’m comfortable taking this to the “working” stage and not troubleshooting it to the “generates no errors” stage.

    If you’re looking at this for an image for ASR (NetRestore, NetInstall-Restore) use, I’d suggest troubleshooting it to the point that it works with less or no errors, per the suggestions and guidance of Greg (gneagle), Joel (mactroll), and Josh (macshome).

    – Patrick

    #374563
    knowmad
    Participant

    I actually set all my MCX records using the guest computer setup just like this.
    the errors (to be honest) don’t bother me as I know what they are, why they are there, and that they are harmless.
    There is a way to make the errors go away, involving a startup script, but then you run into the “must reboot once to make it stick” issue.
    I am ok with my status quo, though eventually I want to set all my MCX settings via command line, that is still a ways off.
    BTW, the http://managingosx.wordpress.com/ website is VERY useful for learning some tricks on controlling things via locally set MCX records.
    I used info from there to set my login screen, force password on waking from sleep/screen saver and a few others that were not so obvious.

    #374567
    christern
    Participant

    Hi
    Just for now it ASR -netrestore from a hard drive and some cli scripts when we make some other setup, our user are local admins 🙁 ) but they get a half managed system that fits our needs when its fresh.

    and thanx for all tips here

    /christer

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.

Comments are closed