2. If the equation with respect to $x$
$$
x^{2}+2(m+3) x+m^{2}+3=0
$$

has two real roots $x_{1}$ and $x_{2}$, then the minimum value of $\left|x_{1}-1\right|+\left|x_{2}-1\right|$ is $\qquad$.
2.6 .

According to the problem, we have
$$
\begin{array}{l}
\Delta=[2(m+3)]^{2}-4\left(m^{2}+3\right) \geqslant 0 \\
\Rightarrow m \geqslant-1 .
\end{array}
$$

Then $x_{1}+x_{2}=-2(m+3)<0$.
When $x=1$, the left side of the equation is greater than 0, thus, $x_{1}$ and $x_{2}$ are on the same side of 1.
$$
\begin{array}{l}
\text { Hence }\left|x_{1}-1\right|+\left|x_{2}-1\right|=2-\left(x_{1}+x_{2}\right) \\
=2(m+4) \geqslant 6 .
\end{array}
$$