Ed Rybicki over at Scientific American:
Tracing the origins of viruses is difficult because they don’t leave fossils and because of the tricks they use to make copies of themselves within the cells they’ve invaded. Some viruses even have the ability to stitch their own genes into those of the cells they infect, which means studying their ancestry requires untangling it from the history of their hosts and other organisms. What makes the process even more complicated is that viruses don’t just infect humans; they can infect basically any organism—from bacteria to horses; seaweed to people.
Still, scientists have been able to piece together some viral histories, based on the fact that the genes of many viruses—such as those that cause herpes and mono—seem to share some properties with cells’ own genes. This could suggest that they started as big bits of cellular DNA and then became independent—or that these viruses came along very early in evolution, and some of their DNA stuck around in cells’ genomes. The fact that some viruses that infect humans share structural features with viruses that infect bacteria could mean that all of these viruses have a common origin, dating back several billion years. This highlights another problem with tracing virus origins: most modern viruses seem to be a patchwork of bits that come from different sources—a sort of “mix and match” approach to building an organism.