ABSTRACT: The bacterial and fungal community involved in ambrosia beetle fungiculture remains poorly studied compared to the famous fungus-farming ants and termites. Here we studied microbial community dynamics of laboratory nests, adults, and brood during the life cycle of the sugarcane shot hole borer, Xyleborus affinis We identified a total of 40 fungal and 428 bacterial operational taxonomic units (OTUs), from which only five fungi (a Raffaelea fungus and four ascomycete yeasts) and four bacterial genera (Stenotrophomonas, Enterobacter, Burkholderia, and Ochrobactrum) can be considered the core community playing the most relevant symbiotic role. Both the fungal and bacterial populations varied significantly during the beetle's life cycle. While the ascomycete yeasts were the main colonizers of the gallery early on, the Raffaelea and other filamentous fungi appeared after day 10, at the time when larval hatching happened. Regarding bacteria, Stenotrophomonas and Enterobacter dominated overall but decreased in foundresses and brood with age. Finally, inferred analyses of the putative metabolic capabilities of the bacterial microbiome revealed that they are involved in (i) degradation of fungal and plant polymers, (ii) fixation of atmospheric nitrogen, and (iii) essential amino acid, cofactor, and vitamin provisioning. Overall, our results suggest that yeasts and bacteria are more strongly involved in supporting the beetle-fungus farming symbiosis than previously thought.IMPORTANCE Ambrosia beetles farm their own food fungi within tunnel systems in wood and are among the three insect lineages performing agriculture (the others are fungus-farming ants and termites). In ambrosia beetles, primary ambrosia fungus cultivars have been regarded essential, whereas other microbes have been more or less ignored. Our KEGG analyses suggest so far unknown roles of yeasts and bacterial symbionts, by preparing the tunnel walls for the primary ambrosia fungi. This preparation includes enzymatic degradation of wood, essential amino acid production, and nitrogen fixation. The latter is especially exciting because if it turns out to be present in vivo in ambrosia beetles, all farming animals (including humans) are dependent on atmospheric nitrogen fertilization of their crops. As previous internal transcribed spacer (ITS) metabarcoding approaches failed on covering the primary ambrosia fungi, our 18S metabarcoding approach can also serve as a template for future studies on the ambrosia beetle-fungus symbiosis.