Hi Mr Jack
No-one knows, nor is it clear that they share a common origin. There is some reason to believe some viruses predate cellular life ...
IIRC, there was some work on virus RNA\DNA that showed homologies between viruses in all branches of cellular life, indication a shared common ancestor.
Indeed there is the hypothesis that they are left overs from the RNA world before DNA and cellular live evolved, that they represent a more primitive form of life between pre-biotic chemical evolution and cellular life.
... but since viruses leave no fossils we have no direct evidence to work with.
Which leaves us with genetic evidence and (informed?) speculation.
Enjoy.