Let's solve a more general problem (Least Squares with Linear Equality Constraints):
$$
\begin{alignat*}{3}
\arg \min_{x} & \quad & \frac{1}{2} \left\| A x - b \right\|_{2}^{2} \\
\text{subject to} & \quad & C x = d
\end{alignat*}
$$
The Lagrangian is given by:
$$ L \left( x, \nu \right) = \frac{1}{2} \left\| A x - b \right\|_{2}^{2} + {\nu}^{T} \left( C x - d \right) $$
From KKT Conditions the optimal values of $ \hat{x}, \hat{\nu} $ obeys:
$$ \begin{bmatrix}
{A}^{T} A & {C}^{T} \\
C & 0
\end{bmatrix} \begin{bmatrix}
\hat{x} \\
\hat{\nu}
\end{bmatrix} = \begin{bmatrix}
{A}^{T} b \\
d
\end{bmatrix} $$
The trick here is to have a look at:
$$ \frac{1}{2} \left\| A x - b \right\|_{2}^{2} = \frac{1}{2} {x}^{T} {A}^{T} A x - {x}^{T} A b + \frac{1}{2} {b}^{T} b $$
So if we set $ w = x $, $ b = \boldsymbol{0} $, $ X = C $, $ d = \boldsymbol{1} $ and $ \frac{1}{2} {A}^{T} A = R $ then your solution is given by:
$$ \begin{bmatrix}
2 R & {X}^{T} \\
X & 0
\end{bmatrix} \begin{bmatrix}
\hat{w} \\
\hat{\nu}
\end{bmatrix} = \begin{bmatrix}
\boldsymbol{0} \\
\boldsymbol{1}
\end{bmatrix} $$
This is easy to solve in MATLAB or Python.
Handling Large System
As a request from @user5045 I add some info how to handle this in case $ R $ and $ X $ are large matrices.
We basically need to solve large scale matrix equation:
$$ \begin{bmatrix}
2 R & {X}^{T} \\
X & 0
\end{bmatrix} \begin{bmatrix}
\hat{w} \\
\hat{\nu}
\end{bmatrix} = \begin{bmatrix}
\boldsymbol{0} \\
\boldsymbol{1}
\end{bmatrix} = e = F g $$
The way to solve it is using an iterative solver.
I case $ R $ is a PSD matrix then the solver should be Preconditioned Conjugate Gradient. In MATLAB it is implemented using pcg()
.
In case $ R $ is only symmetric one should use Minimum Residual Solver. In MATLAB it is implemented as minres()
. For a a general square matrix I'd go with cgs()
.