Home › Forums › Software › InstaDMG › Loginwindow, AdminHostInfo, Name & Password, Custom Desktop Picture
- This topic has 11 replies, 4 voices, and was last updated 16 years, 5 months ago by
christern.
-
AuthorPosts
-
April 10, 2008 at 6:58 pm #372184
Patrick Fergus
ParticipantI’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 fineThoughts?
– Patrick
April 10, 2008 at 9:05 pm #372191Patrick Fergus
ParticipantSo 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
April 11, 2008 at 12:05 pm #372200knowmad
Participantplease tell us how well the mcxset command works
April 11, 2008 at 6:10 pm #372210Patrick Fergus
Participantmcxset 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
April 14, 2008 at 12:28 pm #372236knowmad
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!
April 14, 2008 at 4:49 pm #372241Patrick Fergus
ParticipantI actually am learning as I go regarding mcxset. I don’t have any better resources than you could find with Google. Sorry.
– Patrick
April 14, 2008 at 4:49 pm #372242Patrick Fergus
ParticipantRegarding 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:
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 managerI 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
October 26, 2008 at 9:16 am #374555christern
ParticipantHi Patrick and others in this tread
How is the end of this story? Success?/christer
October 26, 2008 at 12:48 pm #374556Patrick Fergus
ParticipantIIRC (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
October 27, 2008 at 3:33 pm #374563knowmad
ParticipantI 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.October 27, 2008 at 6:05 pm #374567christern
ParticipantHi
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
-
AuthorPosts
- You must be logged in to reply to this topic.
Comments are closed