The electronic spin degrees of freedom in semiconductors typically have decoherence times that are several orders of magnitude longer than other relevant time scales. A solid-state quantum computer based on localized electron spins as qubits is therefore of potential interest. Here, a scheme that realizes controlled interactions between two distant quantum dot spins is proposed. The effective long-range interaction is mediated by the vacuum field of a high finesse microcavity. By using conduction-band-hole Raman transitions induced by classical laser fields and the cavity-mode, parallel controlled-not operations, and arbitrary single qubit rotations can be realized.