1. Preheat oven to 325 degrees Fahrenheit. Drizzle whole onions with one teaspoon olive oil in a baking pan, and drizzle garlic cloves with one teaspoon oil in another baking pan.
2. Roast until tender, about 30 minutes for garlic and an hour and a half for onions. Let cool. Squeeze garlic out of skin and mash. Peel onions and slice.
3. Heat remaining two tablespoons olive oil in a large, heavy saucepan over medium heat. Add onions and sauté for 15 minutes. Stir in garlic.
4. Add chicken stock and thyme, and bring to a boil. Reduce heat and simmer for 15 minutes.
5. Add potatoes and simmer until tender, about 15 minutes. Let cool, then remove thyme sprigs.
6. Purée until smooth. Reheat and serve with croutons.