Virtual synchronous generators (VSG) are widely applied in microgrid technology due to their ability to withstand the impact of grid-connected inverters without inertia. The frequency deviation in the droop control of VSG has a reducing effect on the hosting capacity of the microgrid. Therefore, this article proposes a VSG-based frequency deviation-free control strategy. When the microgrid is in the island/grid connected switching operation mode, it will result in violent fluctuations of the active power on the condition that there is a reactive and fast power change. Therefore, the delay characteristic of a synchronous generator is introduced into VSG to achieve a smooth transition of reactive power and steady-state value that lowers the impact on the system. The rotational inertia is a fixed value, which may fail to meet certain control requirements of the microgrid, such as suppressing power oscillation and rapidly recovering frequency. The fixed moment of inertia is later on improved to an adaptive inertia moment that can effectively solve the problem of rapid rise and fall of frequency as well as improve the frequency response of the microgrid. Finally, the simulation model is established by MATLAB to verify the effectiveness and feasibility of the proposed control algorithm.