Preheat oven to 400 degrees. Generously butter a large (six 1-cup) muffin tin. Sprinkle each cup with salt, pepper, and 1/2 teaspoon sugar; drizzle each cup with 1/2 teaspoon of each vinegar. Put a rosemary sprig in each cup, and cover with an onion round; set aside.
Toss potatoes with chopped rosemary and egg yolk in a medium bowl; season with pepper and 2 teaspoons salt. Divide among cups; dot with butter.
Bake until potatoes are tender and well browned, about 30 minutes. Remove from oven. Let cool 5 minutes. Run a thin knife around edge of each cup to loosen; invert, and serve.