Recently, due to environmental issues and lack of fossil resources, the widespread use of renewable resources has been considered. The use of renewable resources in the power systems leads to decentralized generation and due to the changing nature of such resources, many fluctuations have been added to the network. DC microgrids, as a small power grid, make it easy to use and control such resources in the distribution network. Excessive penetration of power electronic based renewable sources has reduced the inertia and damping making the system more sensitive to disturbances and reducing the system stability margin. This paper uses a DC microgrid structure connected to an AC network equipped with a virtual synchronous machine to manage automatically the power of the DC microgrid and AC networks and analyzing the role of virtual inertia in small signal stability. In order to verify the proposed method, the network has been studied for different operating conditions and inertias. In this method, with the use of the voltage source converter response and proper design dual droop control of the voltage, frequency and active output controllers, the necessary support for adjusting the system frequency are provided to withstand disturbances leading to enhancing stability for different conditions.