Preheat oven to 325 degrees. Mix onions, garlic cloves and 2 teaspoons olive oil in a baking pan.
Roast until garlic and onions are tender, about 30 minutes for garlic. Cool. Squeeze garlic out of skin and mash.
Heat remaining 2 tablespoons olive oil in heavy large saucepan over medium heat. Add onions and sauté 10 minutes. Stir in garlic.
Add 5 cups vegetable broth and thyme, bring to a boil. Reduce heat and simmer 15 minutes.
Add diced potato and simmer until tender, about 15 minutes. Cool mixture slightly. Discard thyme sprigs.
Puree soup in batches in a blender. Return soup to saucepan. Bring to simmer, thinning with more broth, if desired. Season to taste with salt and pepper. Ladle soup into bowls, sprinkle with croutons and serve.