Cut the onions into thin wedges and finely chop the garlic.
Heat a high-sided pan with oil and add the onions and brown sugar a little at a time. The onions should caramelize, and when they are all caramelized, add the balsamic vinegar, lemon, and chopped thyme.
Bring the chutney to a boil, and let it boil for about 30 minutes until it starts to thicken.
Pour the chutney into jars and refrigerate.
The chutney can keep for about 14 days in the refrigerator.