Viruses are packets of DNA in a protein shell. They can't reproduce on their own so take over DNA and protein making machinery of a host to survive. By comparing the genes of bracoviruses that live in parasitic wasps with those of free living insect viruses that haven't inserted their genes into a host genome called nudiviruses, and to their cousins the baculoviruses researchers determined that the two groups split about 310 million years ago. This is as old as insects themselves so insect viruses were already present from the beginning from the evolution of insects. Viruses have been found to infect every type of life; there are even viruses that infect viruses.