Cook the spaghetti or fettuccine according to package instructions until al dente. Drain and set aside, reserving 1/2 cup of the pasta water.
In a large skillet, heat the olive oil over medium heat. Add the sliced onions and sprinkle with salt. Cook, stirring occasionally, for about 15-20 minutes until the onions are golden brown and caramelized.
Add the sugar and minced garlic to the skillet. Cook for an additional 2-3 minutes until the garlic is fragrant.
Pour in the vegetable broth and scrape the bottom of the skillet to deglaze. Let it simmer for about 5 minutes.
Stir in the heavy cream and black pepper. Allow the sauce to simmer for another 2-3 minutes until slightly thickened.
Add the cooked pasta to the skillet, tossing to coat in the sauce. If the sauce is too thick, add some reserved pasta water to reach desired consistency.
Stir in the grated Parmesan cheese until melted and well combined.
Serve immediately, garnished with fresh parsley.