Place onions, butter, sugar and salt in the bottom of a 6-quart slow cooker. Cover and cook for 7 hours on high, or until onions are soft and brown.
Add beef broth, sherry, thyme sprigs and pepper to taste. Cover, and cook on high for another hour.
To serve, add sliced bread (or croutons) across the surface of the soup. Add sliced Gruyere cheese and serve.
Pro tip: Cook for another 15 minutes to melt cheese even further.