Peel the onions and cut into strips. Fry with thyme and chilli in olive oil, season with salt and pepper. Deglaze with Marsala and then pour in the vegetable stock. Cover and simmer for about 15 minutes over low heat, then season to taste.
Boil the pasta in salted water until al dente, drain and mix with butter and onions. Sprinkle with grated parmesan cheese.