Viruses alter the ecological and evolutionary trajectories of bacterial host communities. Plant grafting is a technique that integrates two species or varietiies and have consequences on the rhizosphere functioning. The grafting effects on the taxonomic and functional assembly of viruses and their bacterial host in the plant rhizosphere remain largely elusive. Using shotgun metagenome sequencing, we recover a total of 1441 viral operational taxonomic units from the rhizosphere of grafted and ungrafted plants after 8-year continuous monoculture. In the grafted and ungrafted rhizosphere, the Myoviridae, Zobellviridae and Kyanoviridae emerged as the predominant viral families, collectively representing around 40% of the viral community in each respective environment. Grafting enriched the members in viral family Kyanoviridae, Tectiviridae, Peduoviridae and Suoliviridae, and auxiliary metabolic genes related to pyruvate metabolism and energy acquisition (e.g., gloB, DNMT1 and dcyD). The virus–bacterial interactions increased the rapid growth potential of bacteria, which explains the strong increase in abundance of specific bacterial hosts (i.e., Chitinophagaceae, Cyclobacteriaceae and Spirosomaceae) in the grafted-plant rhizosphere. Overall, these results deepen our understanding of microbial community assembly and ecological services from the perspective of virus–host interactions. © 2025 John Wiley & Sons Ltd.