1. Cook the spaghetti in boiling salted water for about 12 minutes until tender.
2. Meanwhile, place the oil in a saucepan with the onions, and cook for 5 minutes.
3. Add the garlic and cook gently for 5 minutes.
4. Add the mushrooms, heat through slowly.
5. Drain the spaghetti, mix with mushroom, serve.