A virus is a microscopic infectious agent that can only replicate inside the living cells of an organism. Unlike bacteria, viruses are not considered living organisms because they lack the cellular machinery necessary for self-reproduction. They consist of genetic material (either DNA or RNA) enclosed in a protein coat, and sometimes a lipid envelope.