All of these elements are collectively known as RETROELEMENTS; the fact that the reverse transcriptases of all of them have some amino acid identity suggests a common evolutionary origin.
Several reviewers have pointed out that just such an enzyme as reverse transcriptase would have been necessary for the transition from what is widely believed to have been an RNA world - that is, where all the extant organsisms had RNA genomes - to the present world in which all cellular organisms have DNA genomes. Viruses with RNA genomes which use RNA-dependent RNA polymerases for their replication may be the only remnants of that pre-DNA era; however, cellular elements and viruses which use reverse transcriptase may share a common origin as cell-derived "modules" coding for a reverse transcriptase, which evolved to become retrons and retroposons and retrotransposons. Addition of structural proteins may have allowed evolution of retroviruses. The evolution of the DNA retroviruses - Hepadnaviridae, caulimo- and badnaviruses - is more obscure; it appears as though these arose from retrotransposon-like sequences, but this probably occurred near the origin of of these types of element as they are so diverse in sequence and genome organisation.
Reference:
Chapter 7: "Evolution by transposition" (pp. 172-203) in "Fundamental of Molecular Evolution" by Wen-Hsiung Li and Dan Graur; Sinauer Associates, Inc., Sunderland, Mass., 1991