The human gut has an indispensably beneficial ecosystem of bacteria. What are the examples of a virus that becomes symbiotic with an organism, or even incorporates beneficially into the genome of the organism?
In humans, endogenous retroviruses (HERVs) comprise a substantial fraction of the genome, as much as 8%. While many historical viral incorporation events into the primate genome were likely neutral or detrimental (and therefore selected against), some were co-opted and are now functional elements in humans. An example: human syncytin is the envelope gene of a defective HERV, and the protein has been co-opted for fusion during human placentation. More HERV resources here. The Feschotte Lab at Cornell studies the evolution of HERVs and other mobile elements in mammalian genomes, and their lab site provides more resources.
In bacteria, prophage (integrated bacteriophage) can be co-opted by their hosts for niche-specific transcriptional control. A cool example is the pathogen Listeria monocytogenes, which utilizes prophage excision during intracellular growth to activate its Com system and escape from phagosomes.