Home Forums Software InstaDMG Problem with automatic login

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #374586
    trondah
    Participant

    Hi!

    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 🙂

    #374594
    knowmad
    Participant

    That 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.
    knowmad

    #374599
    trondah
    Participant

    Got 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.

    #374604
    knowmad
    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.
    knowmad

    #374609
    trondah
    Participant

    Using 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.

    #374610
    pteeter
    Participant

    I 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?

    #374617
    trondah
    Participant

    As 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.

    #374618
    pteeter
    Participant

    missed it sorry.

    #374620
    trondah
    Participant

    No 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.

    #377877
    Per Olofsson
    Participant

    I 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.

    #379572
    Per Olofsson
    Participant

    And 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.

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

Comments are closed