In a large, regular surface (not non-stick) saute pan, heat the oil over high heat. Add the onions, sugar, thyme, salt and pepper, and saute until starting to caramelize, about 10 minutes. As the onions caramelize, add the vinegar and water in stages, stirring and scraping the edges of the pan, until the onions are very soft and completely caramelized, about 30 minutes.
Remove from the heat and cool at least 15 minutes before serving with the terrine.
Yield: about 3 cups