As it is given that both mass are separated by a certain distance , then centre of mass would be lie in between line joining.
as we know , Rcm = m1r1 + m2r2 / m1 + m2
differentiate both sides we get , dRcm = m1dr1 +m2dr2 / m1+m2
Now , it is given that mass of 6 kg move by 2m , dr2 = 2m and centre of mass remain stationary dRcm = 0.
putting in equation : m1dr1 + m2dr2 =0
2 * dr1 + 6*2 =0
2*dr1 = -12
dr1 = -6m