Electric vehicles (EVs) are thriving to alleviate environmental issues. Conventional two-stage onboard charger (OBC) in EV only contains one large-power DC/DC converter to connect the whole battery pack to the inverter. It requires dozens of battery cells to connect in parallel and then in series for charging. Parallel connection causes circulating current among batteries, increasing the loss and safety risk and decreasing the battery life. Aimed at diminishing the circulating current by reducing parallel connections of battery cells, a distributed OBC architecture is proposed in this paper. It contains a bi-directional inverter and numerous paralleled bi-directional low-power DC/DC converters. The batteries are divided into multiple clusters with less paralleled cells to interface with those DC/DC converters, respectively. Furthermore, a novel virtual synchronous machine (VSM) control is proposed for the distributed OBC, enabling the OBC to provide inertia and frequency regulation to the grid and to serve as an emergency power supply in island mode. Compared to the conventional OBC, the distributed OBC under the proposed VSM control achieves higher fault tolerance, better power allocation, less circulating current among batteries, and less current impact on the batteries. Those priorities are finally verified by simulation results.