This paper presents a distributed optimal control strategy for islanded microgrids, which allows performing reactive power sharing and voltage regulation without using a communication system. To perform the twofold objectives, a small signal model is first developed to reconstruct the system input-output relationship, which is evaluated through sensitivity analysis. A state estimator is then constructed to observe reactive power distribution and system voltages by local measurement. An optimal regulator is developed to perform both reactive power sharing and system voltage restoration. And the dynamic performance of the optimal controller is analyzed, from which the guideline for choosing controller parameters is formulated. The results obtained from sensitivity analysis, simulations, and experiments show that the proposed approach provides the expected reliability and flexibility for optimizing the reactive power sharing and system voltages restoration.