  An SU(4) extrapolation of the chiral unitary theory in coupled channels done
to study the scalar mesons in the charm sector is extended to produce results
in finite volume. The theory in the infinite volume produces dynamically the
$D_{s^*0}(2317)$ resonance by means of the coupled channels $KD$, $\eta D_s$.
Energy levels in the finite box are evaluated and, assuming that they would
correspond to lattice results, the inverse problem of determining the bound
states and phase shifts in the infinite volume from the lattice data is
addressed. We observe that it is possible to obtain accurate $KD$ phase shifts
and the position of the $D_{s^*0}(2317)$ state, but it requires the explicit
consideration of the two coupled channels in the analysis if one goes close to
the $\eta D_s$ threshold. We also show that the finite volume spectra look
rather different in case the $D_{s^*0}(2317)$ is a composite state of the two
mesons, or if it corresponds to a non molecular state with a small overlap with
the two meson system. We then show that a careful analysis of the finite volume
data can shed some light on the nature of the $D_{s^*0}(2317)$ resonance as a
$KD$ molecule or otherwise.
