This paper reports first measurements of the vertical beam size using an X-ray Beam Size Monitor (XRM) for each of the SuperKEKB rings (Low Energy Ring, LER, and High Energy Ring, HER) during Phase 1 and 2 commissioning of SuperKEKB. The XRM device is dedicated to measuring the e−/e+ vertical beam size using X-ray synchrotron radiation, and will eventually have the capability for single-shot (single bunch, single turn) measurements. The preparation of a deep Si detector and high-speed readout electronics for single-shot measurements is underway. In the meantime for Phase 1 and 2, we used a scintillator screen and CCD camera for multi-bunch measurements. The XRM has been installed in each ring and images X-rays from a bending magnet that pass through optical elements (a single pinhole and coded apertures). Several studies (geometrical scale factors, emittance control knob, and beam lifetime study) were carried out during the commissioning. In Phase 1 (February–June 2016), the measured vertical emittances εy are ∼10 pm for LER (consistent with the optical estimation) and ∼35 pm for HER (3.5 × greater than the optical estimation). Analysis of the beam size and lifetime measurements suggests unexpectedly large point spread functions (PSF), particularly in the HER. The spatial resolution of the imaging system (defect of focus, diffraction, and spherical aberration) and scattering in the beamline (EGS5 simulation) contribute ∼6µm of PSF, which does not adequately account for the observed PSF. The Phase 2 commissioning commenced in May–July 2018, with thinner Be filters, new optical elements, scintillator, and CCD camera with the purpose to reduce the PSF in HER. The Phase 2 study results suggest the PSF σs∼6.6µm in HER (corresponding to the spatial resolution of the imaging system and scattering in the beamline), which is ∼5 × smaller than in Phase 1. The overall performances of XRMs in LER and HER are accurate. The XRM in LER will be able to measure the design beam size at the zero current (14µm). For the HER, the PSF that we observed during the Phase 2 indicates that the minimum measured beam size corresponds to the emittance at the design current (12.9 pm) and the XRM will be able to measure the design beam size at the zero current (7 µm).