  We give a description of elementary subgroups (in the sense of first-order
logic) of finitely generated virtually free groups. In particular, we recover
the fact that elementary subgroups of finitely generated free groups are free
factors. Moreover, we give an algorithm that takes as input a finite
presentation of a virtually free group $G$ and a finite subset $X$ of $G$, and
decides if the subgroup of $G$ generated by $X$ is
$\exists\forall\exists$-elementary. We also prove that every elementary
embedding of an equationally noetherian group into itself is an automorphism.
