Ever since the first cells evolved about 3.8 billion years ago, they have had to contend with other life forms intent on killing them. Today, wherever cells exist, viruses exist. It is likely this relationship goes back to time immemorial.
Viruses weren't the only threat to other life forms on the early Earth. The very first predators were probably bacteria that preyed upon other bacteria (PDF). Bdellovibrio, for example, is a modern-day bacterium that invades other bacteria and eats them from the inside. ("Bdello" is derived from the Greek word for "leech" and "vibrio" describes its curved shape.) Eventually, more complex cells called eukaryotes -- the same type of cells of which plants, animals, fungi, and protists are made -- evolved, and they, too, fed upon bacteria.
And, as you might expect, the hunter also became the hunted. Eukaryotes that devoured other eukaryotes evolved at some point, but the exact timing is not known.
To clarify this issue, Susannah Porter of the University of California-Santa Barbara examined evidence of "vampire-like" behavior in 740-780-million-year-old fossils of protists (single-celled eukaryotes) found in the Grand Canyon. Her findings were published in Proceedings of the Royal Society B.
Some protists produce walls, and after the protists die, the walls can become fossilized. (The walls, also called "tests," can be quite beautiful.) Curiously, Dr. Porter noticed that the fossils she examined contained strange micrometer-sized holes. (See photo above.)
After ruling out other potential explanations (e.g., specialized cell wall pores, mineral perforation, and degradation), she concluded that the holes are best explained as drill holes created by predatory protists seeking to slurp out whatever was inside the shell. Similar to Bdellovibrio, some of these protists physically crawl inside the shell and eat the protist from within. Vampyrellidae, a modern-day family of protists, behaves in just this manner.
The natural history of our planet, therefore, shows that microorganisms were vampires long before Twilight made it cool be a vampire.
Source: Porter SM. "Tiny vampires in ancient seas: evidence for predation via perforation in fossils from the 780–740 million-year-old Chuar Group, Grand Canyon, USA." Proc. R. Soc. B 283: 20160221. Published: 18-May-2016. http://dx.doi.org/10.1098/rspb.2016.0221