Ok it is loading in safe mode and my desktop is normal. Thank you! What went wrong and what can I do to fix it?
To find out what is causing it will take a little work. Given the point of failure is when your Desktop is loading, that leads me to think that something being launched by your launchd process is causing it. To be sure, I need you to try a few more things.
If you haven't already, confirm the problem still exists after booting into safe mode. While unlikely, given the point of failure, the removal of the various boot caches may have fixed the problem.
If the problem still exists, continue on.
Disable automatic login
While in safe mode, disable automatic login.
1. Open System Preferences
2. Click on "Accounts"
3. Click "Login Options" on the bottom of the left pane
4. You will probably have to authenticate, so click the lock in the bottom right corner and enter your password
5. At the top, change "Automatic login" to "Off"
6. Reboot
Allow the Mac to boot normally
Safe Login
1. If you get to the login window successfully, we have ruled out a number of potential problems (Launch Daemons, StartupItems (outdated launch daemons), fonts, 3rd party kexts, etc.)
2. Click your name (or type your username, depending on your login window settings)
3. Enter your password but do not hit enter/return
4. Hold down the shift key
5. While holding shift, click the "Login" button
If it logs in properly then, as I suspected, the problem would be Local and User LaunchAgents.
These are located in
~/Library/LaunchAgents and
/Library/LaunchAgents. (* NOTE, older versions of OS X utilize the LoginItems folder *)
Few LaunchAgents
It is likely that you have very few LaunchAgents in either Library, or maybe just one. In that case, moving the that item to your Desktop is an easy way to determine if that is the cause.
To do this:
1. Navigate to the LaunchAgent folders listed above
2. Move the plist(s) to your Desktop (if you have plists in both, you may want to create folders called Local and User to separate them if you wish to put them back)
3. Now, reboot (or logout) and try to login normally, if it works one of those items is the problem
Many LaunchAgents: Narrowing it down
Everyone has a different setup with various 3rd party software. So I can't tell you what exactly is causing it, but you can solve it with some detective work. If you have a lot of LaunchAgents, thinking about your system and what may be causing it will help you narrow it down.
1. Think about what 3rd party software you have and specifically what loads at startup. Based on what is happening, it may be something that adds to or modifies the GUI in some way.
2. Looking at the logs during a failed login attempt may illuminate you as to the point of failure.
To do this, open up Console (/Applications/Utilities/Console) and navigate to a time when a login failure occurred. If the above guidance led you to Launch Agents, then you will be looking for lines that have a Sender[PID] of com.apple.launchd.peruser.UID, where UID is your user ID (the first account on a Mac has a UID of 501).
3. If you have an idea of what it may be, simply navigate to one of the LaunchAgent folders listed above and move the plist from the folder.
The name *should* relate to the developer that created it and it will be in reverse domain format, for example: com.adobe.XXX or com.google.XXX
Update your software
If you have determined what the problem is, check for an update for that software. As the developer may have fixed whatever incompatibility arose.
If there is no update, alert the developer and work with them to solve the problem. And for now, remove the LaunchAgent until the problem is fixed.
Comments
I know this is a lot of info, but being in tune with your system helps make troubleshooting much easier. You may already have an idea of what may be causing, or can easily narrow it down. Feel free to report back with new information and I can walk you through solving the problem.