The retina, located outside the cranium, serves as an ideal structure for investigating information processing within the central nervous system due to its well-organized neurovascular unit comprising diverse cell types, including neurons, glial cells (such as microglia, Müller glia, and astrocytes), pericytes, and vascular endothelial cells. Disrupted retinal homeostasis contributes to various ocular diseases such as diabetic retinopathy, age-related macular degeneration, glaucoma, and retinitis pigmentosa. However, noninvasive in vivo imaging methods to study the pathogenesis of these disorders remain limited. Here, we developed a two-photon microscopy technique for real-time, transpupillary in vivo visualization of the retinal neurovascular unit in mice. Our approach integrates systematic head fixation, a custom-made polymethyl methacrylate contact lens, and a glycerin immersion objective lens with an extended working distance and a higher numerical aperture, specifically designed for two-photon microscopy. This method enabled us to visualize dynamic microglial process activity around retinal blood vessels. Our results revealed that retinal microglia exhibit enhanced surveillance under diabetic conditions, which is undetectable by static confocal microscopy. Furthermore, we demonstrated that liraglutide, a glucagon-like peptide-1 receptor agonist commonly used for the treatment of diabetes and obesity, reversed the enhanced microglial behaviors in the diabetic retina. Our simple yet effective approach mitigates the need for advanced optical systems like adaptive optics, providing an effective tool for real-time imaging of the retina. This method offers a valuable resource for visual neuroscience research and holds great potential for clinical applications, particularly in the early diagnosis, intervention, and monitoring of retinal diseases.