To optimize the energy supply potential and complementary advantages of distributed energy, this paper focuses on the dispatching optimization of cogeneration virtual power plant considering uncertainty. First of all, wind power, photovoltaic, combined heat and power (CHP) units, electric boilers, and controllable loads are integrated into a CHP virtual power plant. Then, carbon capture and electric-to-gas devices are introduced to realize carbon recycling. Furthermore, quantify the risk of real-time dispatching of virtual power plants through uncertainty scenario generation and conditional value at risk (CVaR) theory, and the multi-objective stochastic dispatching optimization model of virtual power plants is built with the aim at minimizing the operation cost, carbon emissions, and operation risk as the objectives, and the CRITIC weighting method is adopted to solve it. Finally, the calculation results show that: 1) the electric boiler can use wind and photovoltaic power to supply heat for the system, reduce the dependence of the virtual power plant (VPP) on the CHP unit, and make the electric output of the unit more flexible. 2) The risk quantification method proposed can fully measure the risk situation in real-time dispatching, arrange the wind and photovoltaic power generation plan and backup plan more reasonably, and enable the VPP to get more benefits while avoiding the risks in real-time dispatching.