Peel and julienne the onions. Heat the oil in a pan, and sweat the onions until soft. Sprinkle with the sugar, and cook until caramelized.
Deglaze with the vinegar and wine, and simmer for 25 minutes over low heat. Pour into jars and let cool. This goes very well with roasted meats.