Viruses account for the most abundant biological entities in the biosphere and can be either symbiotic or pathogenic. While pathogenic viruses have developed strategies to evade immunity, the host immune system evolved overlapping and redundant defenses to sense and fight viral infections. Nutrition and metabolic needs sculpt viral-host interactions and determine the course and outcomes of the infection. In this review, we focus on the hexosamine biosynthesis pathway (HBP), a nutrient sensing pathway that controls immune responses and host-viral interactions. The HBP converges on O-GlcNAcylation, a dynamic post-translational modification of cellular proteins, that emerged as a critical effector of immune cell development, differentiation and effector functions. We highlight recent discoveries identifying the impact of this metabolic modification on anti-viral immunity and viral restriction, and conversely on exacerbating viral-induced pathologic inflammation or viral oncogenesis. We discuss the clinical implications of these findings and perspectives of harnessing this pathway for therapeutic purposes.