Put the onions in a large bowl and tip over a kettle of boiling water. Leave for 20 seconds then pour into a colander, return to the bowl and pour over lots of very cold water. The skins should now peel off very easily.
Meanwhile pour the vinegar and sugar into a large saucepan with the peppercorns, mustard seeds and bay leaves. Put the lid on the pan, bring to the boil then remove from the heat and set aside to allow the spices to infuse.