While not a regular problem, people using OS X might find their desktop backgrounds change to either a default starry space image, or to a flat grey. This happens when performing a specific task such as attaching an external monitor or waking from sleep, but it could happen more randomly.
As with most operating systems, OS X has the option to customize the desktop by adding personal pictures or artwork to the desktop background. These customizations can be done in the Desktop & Screen Saver system preferences, where you will be able to set a background from those that Apple provides, those in your iPhoto or Aperture libraries, or from a specified alternative location on the hard drive.
If your desktop image is reverting or otherwise changing, then there are several things you can do to get it back. First try simply logging out and logging back in, or even restarting the computer if you are not in the middle of work. While OS X Lion's Resume feature will allow you to more easily continue your work upon log-in, in older versions of OS X this feature is not available.
If the problem is more persistent and happens continually, or if you do not wish to restart the system to clear it, then you can try a few different approaches to hopefully clear the problem.
- Check the location of photos
If you use secondary storage such as a second internal drive, networked drive, or external USB or FireWire drive, then ensure the photos you use for your background are not on this drive. If the system loses connection to this drive, then the photos stored on it will not be loaded, especially if you change aspects of the graphics system by changing resolutions or monitor setups, or by logging into your system.
Many people often keep their Aperture and iPhoto libraries on secondary drives because they get very large, so one solution for this is instead of using the system's settings to target images in the image libraries, to keep them in the account folder on your boot drive. Select your libraries and export them to a specific folder in your account (such as one called "desktopimages" in your Pictures folder), and then add this folder to the Desktop images list in the system preferences by clicking the plus button below the list.
- Change the graphics settings
Sometimes the system may show a gray background if it has not properly loaded the desktop settings upon switching graphics modes. This is especially true if you have a multi-GPU setup such as that in Apple's laptops, and unfortunately when this happens selecting a new desktop image in the system preferences will not have any effect.
Usually if this happens, you can spur the graphics system to reload the desktop configuration by purposefully invoking a change in it. Some easy options for doing this are to change the resolution temporarily, sleep and wake the system, attach and then detach an external monitor, or toggle the graphics mode in the Energy Saver system preferences.
- Remove configuration files
If desktop settings do not seem to stick and as a result your desktop backgrounds are always the default image of a starry space scene, then you might benefit from clearing the configuration files associated with your desktops.
The first of these is the preferences file for the desktop itself, which is called "com.apple.desktop.plst" and is located in the /Users/username/Library/Preferences/ folder. You can delete this file using the Finder, or by running the following command in the Terminal:
After removing this file you will have to set up background images again for each desktop on each monitor device you have attached to the system.
The second set of property lists to remove would be those for the Dock, since the Dock process manages multiple desktops on the system (Spaces, Mission Control, etc.). However, do keep in mind that removing these property lists will cause the Dock's configuration to reset, so first be sure you save a reference of what the Dock looks like before you proceed with this. One easy way to do this is to press Shift-Command-3 to take a screenshot of the Dock. After you have removed the Dock's property list files, then you can use this screenshot as a reference for rebuilding the Dock.
The two files used for the Dock's configuration are called "com.apple.dock.plist" and "com.apple.dock.db," and as with the desktop preference file are located in the /Users/username/Library/Preferences/ folder. You might also have a file called "com.apple.dock.extra.plist" in this folder, which you can remove along with the others. Terminal commands to remove these files are the following: