Cook pasta in a large pot of boiling water until done. Drain.
Meanwhile, heat the oil in a frying pan over medium heat.
Add pesto, onion, and salt and pepper. Cook about five minutes, or until onions are soft.
Using a large bowl, mix pesto mixture into pasta. Stir in grated cheese. Serve.