Abstract The hot halo gas distribution in the inner Milky Way (MW) contains key fossil records of the past energetic feedback processes in the galactic center. Here, we adopt a variety of spherical and disk-like MW halo gas models as initial conditions in a series of simulations to investigate the formation of the Fermi bubbles in the jet-shock scenario. The simulation results are compared directly with relevant X-ray and gamma-ray observations of the Fermi bubbles to constrain the halo gas distribution in the inner Galaxy before the Fermi bubble event. Our best-fit gas density distribution can be described by a power law in radius n e(r) = 0.01(r/1 kpc)−1.5 cm−3. Our study cannot determine if there is an inner density core, which if exists, should be very small with size r c ≲ 0.5 kpc. When extrapolating to large radii r ∼ 50–90 kpc, our derived density distribution lies appreciably below the recently estimated gas densities from ram pressure stripping calculations, suggesting that the halo gas density profile either flattens out or has one or more discontinuities within 10 ≲ r ≲ 50 kpc. Some of these discontinuities may be related to the eROSITA bubbles, and our derived gas density profile may correspond to the hot gas distribution in the inner eROSITA bubbles about 5 Myr ago.