  We present a string theory construction of Omega-deformed four-dimensional
gauge theories with generic values of \epsilon_1 and \epsilon_2. Our solution
gives an explicit description of the geometry in the core of Nekrasov and
Witten's realization of the instanton partition function, far from the
asymptotic region of their background. This construction lifts naturally to
M-theory and corresponds to an M5-brane wrapped on a Riemann surface with a
selfdual flux. Via a 9-11 flip, we finally reinterpret the Omega deformation in
terms of non-commutative geometry. Our solution generates all modified
couplings of the \Omega-deformed gauge theory, and also yields a geometric
origin for the quantum spectral curve of the associated quantum integrable
system.
