|Viruses are genomic fragments that can replicate only in the context of an intact living cell. They cannot therefore be primitive antecedents of cells.
Within a given species, viruses may have emerged as genetic fragments or reduced versions from chromosomes, plasmids, or RNA of
1) the host or related species
2) distant species
3) larger parasites of the same or different hosts
4) further evolution and genetic interchange among existing viruses
Once established, they may then cycle back into the genome of the host as an integrated episome; there they may have genetic functions or in principle might reemerge as new viruses.
These cycles have some substantiation in the world of bacterial viruses; but we have no clear data on the provenience of plant or animal viruses.