- This topic has 11 replies, 5 voices, and was last updated 14 years, 6 months ago by
Per Olofsson.
-
AuthorPosts
-
October 29, 2008 at 1:33 pm #374586
trondah
ParticipantHi!
I’ve enabled automatic login in my image like this:
/usr/bin/defaults write $3/Library/Preferences/com.apple.loginwindow autoLoginUser “user”
And a proper kcpassword file has been placed under /etc.
This does not seem to work properly, upon first boot the loginwindow will select the user for login, but the password isn’t entered.
If I reboot the machine it works fine, but why doesn’t it work the first time?What’s really strange is that after some trial and error changing some scripts, I managed to make an image that works fine.
Problem is, I can’t seem to find out what I changed that made it work, and now I can’t reproduce a working image again….Please help 🙂
October 29, 2008 at 11:42 pm #374594knowmad
ParticipantThat you made it work fine on first boot is actually kind of surprising.
Most if not all of the settings I make outside of MCX records require reboots to take effect.
knowmadOctober 30, 2008 at 11:33 am #374599trondah
ParticipantGot it to work again using PlistBuddy instead of defaults:
/usr/libexec/PlistBuddy -c “Add autoLoginUser string user” $3/Library/Preferences/com.apple.loginwindow.plist
Bingo!
This time I removed any other customizations to the loginwindow also, gonna try to find out if any of those was the culprit or if it’s just a matter of using PlistBuddy.
October 30, 2008 at 3:56 pm #374604knowmad
Participant[QUOTE][u]Quote by: trondah[/u][p]This time I removed any other customizations to the loginwindow also, gonna try to find out if any of those was the culprit or if it’s just a matter of using PlistBuddy.[/QUOTE]
Please keep us posted. If it was just plistbuddy vs defaults…. thats REALLY important to know, it would change quite a bit of how I work.
knowmadOctober 30, 2008 at 5:53 pm #374609trondah
ParticipantUsing defaults didn’t work. com.apple.loginwindow doesn’t exist until you write something to it, and creating it by using the command above doesn’t work. The loginwindow selects the user but doesn’t enter the password. It did work on one of my previous builds as mentioned though, I have no idea why.
On a sidenote, now that I’m using PlistBuddy to create the file, I noticed that PlistBuddy creates it in XML format instead of the standard binary plist format. Then I’m using the defaults command to write my other customizations in the loginhook, but I think I’ll consider using PlistBuddy more.
October 30, 2008 at 6:28 pm #374610pteeter
ParticipantI think we are missing something.
/etc/kcpassword has to be created with the password of the user for this to work.
For deployment, it might be easiest to create the correct kcpassword file, drop it in /etc with a pkg, then do the PlistBuddy command in a postflight script.
Anyone else care to comment?
October 30, 2008 at 11:00 pm #374617trondah
ParticipantAs I mentioned in my first post, a proper kcpassword is in place. I’ve now narrowed it down to defaults vs PlistBuddy. One of the commands generates a working autologin com.apple.loginwindow.plist, the other does not. The actual deployment is being done to the image is done with a package and postinstall script.
October 30, 2008 at 11:16 pm #374618pteeter
Participantmissed it sorry.
October 31, 2008 at 9:05 am #374620trondah
ParticipantNo worries. If anybody should find anything new on this subject, I’d be glad if you could leave a note here. I’m happy that I have a solution with PlistBuddy but would like to know exactly why that’s working and defaults is not.
January 26, 2010 at 1:44 pm #377877Per Olofsson
ParticipantI found this topic while investigating the same problem: automatic login fails the first time but works after a reboot. No login is performed inbetween, I just click reboot on the login window. I switched to PlistBuddy instead of defaults, but there is no change.
September 29, 2010 at 4:01 pm #379572Per Olofsson
ParticipantAnd the fix for this was revealed today at [url=http://www.macsysadmin.se/]MacSysAdmin[/url] by Karl Kuehn and Duncan McCracken: /Library/Preferences/com.apple.loginwindow.plist permissions need to be 664, and owned by root:admin.
Unfortunately DeployStudio appears to muck up the permissions of loginwindow.plist, making the automatic login fail the first time the machine boots.
-
AuthorPosts
- You must be logged in to reply to this topic.
Comments are closed