Wipe the mushrooms, but do not wash or peel them, and trim stems. Put into a pan with the other ingredients. Simmer until mushrooms are tender, then lift them out with a slotted spoon and pack into preserving jars. Remove the onions and ginger. Bring the vinegar to the boil and pour over the mushrooms. Seal tightly.