Yes, sores in the mouth are usually caused by a virus. You usually get viruses when you're worn down- not enough sleep, rest, or nutrition.
I'd recommend taking a multivitamin supplement- prenatals or even a kids daily- and try to eat well and get rest.Â
Also, obviously, avoid things that can make it worse. Coffee and chocolate, spicy or acid foods (like orange juice, strawberries, or pineapple), and also very "sharp" crunchy foods like tortilla chips could make it worse.
Eating lots of yogurt, drinking kefir or cultured milk, and rinsing with salt water might make you more comfortable and speed the healing.