Microgrid concept (MG) is regarded as the best solution for optimal integration of the renewable energy sources (RESs) into power systems. However, novel control strategies should be developed because of the distinct inherent feature of MG components in comparison to conventional power systems. Although the droop-based control method is adopted in the MG to share power among distributed generation units, its dependency to grid parameters makes its implementation not as convenient as that in conventional power systems. Virtual impedance has been proposed as the complementary part of droop control in MGs. In this paper, adaptive virtual impedance is designed considering its effects on the system performance in the MG including: 1) Decoupling active and reactive power control by making the grid X/R ratio high, 2) Maximum transferable power through the feeder, 3) Stability concern, 4) Precise reactive power sharing in different operating modes as well as smooth transition from connected mode (CM) to islanded mode (IM). To this end, a novel method is proposed to determine the reactive power reference of distributed generation (DG) units according to their contribution in reactive power sharing in IM. In addition, simulation in MATLAB/SIMULINK environment is conducted to assess the performance of the control system.