  The halo of the Milky Way contains a hot plasma with a surface brightness in
soft X-rays of the order $10^{-12}$erg cm$^{-2}$ s$^{-1}$ deg$^{-2}$. The
origin of this gas is unclear, but so far numerical models of galactic star
formation have failed to reproduce such a large surface brightness by several
orders of magnitude. In this paper, we analyze simulations of the turbulent,
magnetized, multi-phase interstellar medium including thermal feedback by
supernova explosions as well as cosmic-ray feedback. We include a
time-dependent chemical network, self-shielding by gas and dust, and
self-gravity. Pure thermal feedback alone is sufficient to produce the observed
surface brightness, although it is very sensitive to the supernova rate. Cosmic
rays suppress this sensitivity and reduce the surface brightness because they
drive cooler outflows. Self-gravity has by far the largest effect because it
accumulates the diffuse gas in the disk in dense clumps and filaments, so that
supernovae exploding in voids can eject a large amount of hot gas into the
halo. This can boost the surface brightness by several orders of magnitude.
Although our simulations do not reach a steady state, all simulations produce
surface brightness values of the same order of magnitude as the observations,
with the exact value depending sensitively on the simulation parameters. We
conclude that star formation feedback alone is sufficient to explain the origin
of the hot halo gas, but measurements of the surface brightness alone do not
provide useful diagnostics for the study of galactic star formation.
