The word 'life' isn't precisely defined. It's more of a family resemblance concept. Life (as we know it, here on Earth... a sample size of one) has a variety of qualities (metabolism, reproduction, homeostasis, a particular sort of genetic code, evolves by natural selection etc.). If something shares enough of these qualities, we call it 'life'. So it's kind of a fuzzy boundary.
(These kind of philosophy of biology considerations will become very important if we ever encounter extraterrestrial "life". Just recognizing it as life in the first place is apt to be a challenge.)
Viruses lack metabolism. They lack the ability to reproduce on their own and require living cells to do that. But... they do possess a genetic code that's very similar to that of prokaryotic and eukaryotic organisms. (They would have to, if they reproduce by hijacking those cells.)
I don't consider viruses alive and I think that most biologists agree. But that being said, they are very similar to life and may indeed have some kind of common origin. Something explains the genomic simularities.