  The existence of hot, accreted gaseous coronae around massive galaxies is a
long-standing central prediction of galaxy formation models in the $\Lambda$CDM
cosmology. While observations now confirm that extraplanar hot gas is present
around late-type galaxies, the origin of the gas is uncertain with suggestions
that galactic feedback could be the dominant source of energy powering the
emission. We investigate the origin and X-ray properties of the hot gas that
surrounds galaxies of halo mass, $(10^{11}-10^{14}) \mathrm{M}_\odot$, in the
cosmological hydrodynamical EAGLE simulations. We find that the central X-ray
emission, $\leq 0.10 R_{\mathrm{vir}}$, of halos of mass $\leq 10^{13}
\mathrm{M}_\odot$ originates from gas heated by supernovae (SNe). However,
beyond this region, a quasi-hydrostatic, accreted atmosphere dominates the
X-ray emission in halos of mass $\geq 10^{12} \mathrm{M}_\odot$. We predict
that a dependence on halo mass of the hot gas to dark matter mass fraction can
significantly change the slope of the $L_{\mathrm{X}}-M_{\mathrm{vir}}$
relation (which is typically assumed to be $4/3$ for clusters) and we derive
the scaling law appropriate to this case. As the gas fraction in halos
increases with halo mass, we find a steeper slope for the
$L_{\mathrm{X}}-M_{\mathrm{vir}}$ in lower mass halos, $\leq 10^{14}
\mathrm{M}_\odot$. This varying gas fraction is driven by active galactic
nuclei (AGN) feedback. We also identify the physical origin of the so-called
"missing feedback" problem, the apparently low X-ray luminosities observed from
high star-forming, low-mass galaxies. This is explained by the ejection of
SNe-heated gas from the central regions of the halo.
