Inverse Galois problem for $GL_2$ of a compact local ring Let $A$ be complete noetherian local ring with maximal ideal $m$ and residue field $A/m$ a finite field (in other words, $A$ is a noetherian compact local ring)

For which $A$ as above is there a subgroup of $GL_2(A)$ containing $SL_2(A)$ which is the Galois group of a Galois extension of $\mathbb Q$
  unramified outside a finite set of primes $S=S(A)$?

(The italic part of the question above has been edited: the first, ill-formulated, version of this question asked if $GL_2(A)$ itself was a Galois group over $\mathbb Q$ 
 and has been answered by Will Savin below).
For example, we know since the work of Serre on the points of torsion of elliptic curves that when $A=\mathbb Z_p$, the answer is yes. On the other hand, the answer should not be always yes: when $A$ has Krull dimension $5$ or more for instance, such a group would define
a deformation to $A$ of the representation $G_{\mathbb Q,S} \rightarrow GL_2(A/m)$, which would have to be a quotient of the universal deformation ring of that representation, and these deformation ring are expected to have dimension at most $4$ (see Mazur's article in Galois Groups over A).
Obviously, I would be very very surprised if I received a complete answer to this question, but is it possible to give a conjectural answer, based on the most optimistic conjectures on the inverse Galois problems (e.g. Shafarevich's conjecture that $Gal(\mathbb Q/ \mathbb Q^{ab})$ is a free profinite group of countable rank), or at least, some reasonable guess?
 A: Claim: Given a representation from the Galois group to $GL_2(\mathbb F_q)$ (maybe $p>2$ to be safe) whose image contains $SL_2(\mathbb F_q)$, if $R$ is any quotient of the deformation ring of that representation (actually, the ring parameterizign deformations with fixed determinant character), then the image of the induced map to $GL_2(R)$ contains $SL_2(R)$.
Proof: By a limit we may reduce to finite length rings. Then by induction we may reduce to an extension by $\mathbb F_q$.
So let $R$ be a quotient of the deformation ring with maximal ideal $m$ and an ideal $I$ that is isomorphic as an $R$-module to $R/m$. Assume the representation to $GL_2(R/I)$ contains $SL_2(R/I)$. We must show that the representation to $GL_2(R)$ contains $SL_2(R)$.
It's sufficient to show that it contains the kernel of $SL_2(R)$ to $SL_2(R/I)$ or by conjugation sufficient to show that it contains any nontrivial element of that kernel.
If $I$ is contained in $m^2$, we can take $a,b \in m$ with $ab$ generating $I$ and take the commutator of the two matrices:
$$ \left[ \begin{pmatrix} 1 & a \\ 0 & 1 \end{pmatrix}, \begin{pmatrix} 1 & 0 \\ 0 & 1+b \end{pmatrix} \right] =\begin{pmatrix} 1 & ab \\ 0 & 1 \end{pmatrix} $$
By surjectivity in $R/I$, we have two matrices congruent mod $I$ to these, and their commutator will be the same. So that handles that case.
If $I$ is contained in $(p)$, you can do the same thing with 
$$\begin{pmatrix} 1 & a \\ 0 & 1 \end{pmatrix}^p = \begin{pmatrix} 1 & pa \\ 0 & 1 \end{pmatrix}$$
Otherwise $I$ corresponds to an element of $m/(p,m^2)$, which comes from a nontrivial extension class of the representation with itself. It's sufficient to show that for such a nontrivial extension there are some nontrivial elements that fix the sum and quotient. But otherwise you would get a nontrivial extension of the standard representation of $SL_2(\mathbb F_q)$ as a representation of $SL_2(\mathbb F_q)$, which there probably isn't by modular representation theory.
OK so this proof is not completely rigorous. But I think it can be made so with a bit more care.
Anyway, this would show that the question is basically equivalent to Passerby's version about quotients of deformation rings.

Very rarely. If $GL_2(A)$ is a Galois group then $GL_1(A)$ is a Galois group.
So in particular $Hom ( GL_1(A), \mathbb Z/p)$ must be finite, because there are finitely many $\mathbb Z/p$-extensions ramified outside a given finite set of primes.
If the residue field of $A$ has characteristic $p$, then $(A/p)^\times$ had better also have finite maps to $\mathbb Z/p$, which I think implies that it has Krull dimension $0$. Then it will be finite, and $A$ will be a finite extension of $\mathbb Z_p$ by Nakayama's lemma.
If $A$ is the ring of integers of a degree $n$ extension of $\mathbb Z_p$, then $GL_1(A)$ maps to $\mathbb Z_p^n$, so $\mathbb Z_p^n$ is also a Galois group over $\mathbb Q$. But $\mathbb Q$ has a unique $\mathbb Z_p$-extension, the cyclotomic extension. 
So I think just $\mathbb Z_p$ works here.
A: This isn't an answer, just some idle thoughts about the following closely related problem:
Which complete local Noetherian rings $A$ 
can occur as the quotient of the universal deformation ring $R$ of a representation
$\rho: G_{\mathbb{Q},S} \rightarrow \mathrm{GL}_2(\mathbb{F}_q)$? 
Such a universal ring $R$ should always have dimension $4$ and  be a complete intersection, at least conjecturally.   
So straight away  the following question occurs:
is the set $\mathcal{X}$ of   isomorphism classes of complete, local, Noetherian, integral,  $4$-dimensional  $W(\mathbb{F}_q)$-algebras actually uncountable?    (Conditions slightly edited)
I don't know the answer  but if indeed $\mathcal{X}$ is uncountable, that
seems to be a problem:  Only finitely many of the elements of $\mathcal{X}$ could occur as quotients of each of the countably many  universal $R$s (namely, one for each minimal prime ideal of $R$).  
On the other hand, I think one  might be able to verify   that
the set of universal deformation rings is dense in $\mathcal{X}$ (for  some reasonable topology).  For example,
I believe that any Artin local  $A$ is a quotient of an $R$ as above. This  should follow from the method of Taylor and Wiles: they show that you can get a formal power series ring, in as many variables as you want, as a limit of such deformation rings $R$. 
