An important scientific debate focuses on the possibility of abiotic synthesis of hydrocarbons during oceanic crust-seawater interactions. While on-site measurements near hydrothermal vents support this possibility, laboratory studies have provided data that are in some cases contradictory. At conditions relevant for sub-surface environments it has been shown that classic thermodynamics favour the production of CO2 from CH4, while abiotic methane synthesis would require the opposite. However, confinement effects are known to alter reaction equilibria. This report shows that indeed thermodynamic equilibrium can be shifted towards methane production, suggesting that thermal hydrocarbon synthesis near hydrothermal vents and deeper in the magma-hydrothermal system is possible. We report reactive ensemble Monte Carlo simulations for the CO2 methanation reaction. We compare the predicted equilibrium composition in the bulk gaseous phase to that expected in the presence of confinement. In the bulk phase we obtain excellent agreement with classic thermodynamic expectations. When the reactants can exchange between bulk and a confined phase our results show strong dependency of the reaction equilibrium conversions, XCO2, on nanopore size, nanopore chemistry, and nanopore morphology. Some physical conditions that could shift significantly the equilibrium composition of the reactive system with respect to bulk observations are discussed.