In a large frying pan over medium-high heat, cook the onions with the butter until the onions are translucent. Add the bacon and the mushrooms and cook until all the mushrooms juices are evaporated. Add and the wine. Lower the heat and let it cook for a couple of minutes.
In a large serving bowl, beat the 2 eggs with salt (not too much) and the pepper. Add the Parmigiano and incorporate well.
Meanwhile in a large pan, boil the water with salt. Cook the pasta al dente and drain. Immediately pour over the egg mixture and mix well. Add the bacon-onion-mushrooms and wine sauce and mix well. Serve hot.