Answer
$F=\frac{M}{2asin\theta}$
Work Step by Step
We can determine the required force as follows:
The virtual displacement is given as
$\delta_{xA}=\frac{d(2asin\theta)}{d\theta}=-2asin\theta$
The virtual-work equation is
$\delta U=0$
$M+F\delta_{XA}=0$
$\implies M+F(-2asin\theta)=0$
This can be rearranged as:
$F=\frac{M}{2asin\theta}$