To explore the influence of various atmospheres containing CO2 on biogas production from coal, bituminous coal D from Qianqiu Mine in Henan Province was collected for use in biogenic gas production experiments performed on coal in various atmospheres. In these experiments, the gas concentration, gas production and microbial community structure were measured and analyzed, and the pH, volatile fatty acid (VFA) concentration, chemical oxygen demand (COD) concentration and NH4+-N concentration were analyzed in the liquid phase after the gas production. The results revealed that the atmospheric components greatly influence the concentration and production of methane. The methane production was the lowest (0.37 mmol/g) in the N2 atmosphere and highest (0.92 mmol/g) in the atmosphere of H2/CO2 = 4. Meanwhile, at the end of the biogas production, the pH value of the bacterial liquid in the CO2 atmosphere was the lowest (6.59), and the pH value in the H2/CO2 = 5 atmosphere was the highest (7.77). The VFA concentration in the liquid phase was low, and a high concentration of CO2 did not inhibit the degradation of VFA. The trend of the change in COD was consistent with that of methane production. In addition, the analysis of the microbial community structure showed that the bacterial phyla in various atmospheres were dominated by Proteobacteria, Bacteroidetes and Firmicutes, and CO2 promoted the homoacetogenic process in the system. Low concentrations of CO2 are beneficial for the growth of acetotrophic methanogens and methylotrophic methanogens, and the addition of H2 enriches methanogenic microorganisms. The mutual promotion and inhibition of microorganisms was the basis for the observed differences in methane production. Hence, the experimental results provide a reference for carbon dioxide sequestration in coal seams and conversion to biogas.