We demonstrate a step-by-step protocol for the investigation of gene function in peritoneal tissue-resident macrophages in vivo, using lentiviral vectors.