Quarter, core, peel the peaches and cut into small cubes. Peel the onions and cut into fine cubes.
Put the peaches, onions, sugar, vinegar and spices in a saucepan and bring to the boil. Skim and boil for about 1 1/2 hours. Pour everything into clean glasses while still hot, close immediately and turn upside down.