Skeletal fragility is associated with type 2 diabetes mellitus (T2D), but the underlying mechanism is not well understood. Here, in a mouse model for youth-onset T2D, we show that both trabecular and cortical bone mass is reduced due to diminished osteoblast activity. Stable isotope tracing in vivo with13C-glucose demonstrates that both glycolysis and glucose fueling of the TCA cycle are impaired in diabetic bones. Similarly, Seahorse assays show suppression of both glycolysis and oxidative phosphorylation by diabetes in bone marrow mesenchymal cells as a whole, whereas single-cell RNA sequencing reveals distinct modes of metabolic dysregulation among the subpopulations. Metformin not only promotes glycolysis and osteoblast differentiation in vitro, but also improves bone mass in diabetic mice. Finally, osteoblast-specific overexpression of either Hif1a, a general inducer of glycolysis, or Pfkfb3 which stimulates a specific step in glycolysis, averts bone loss in T2D mice. The study identifies osteoblast-intrinsic defects in glucose metabolism as an underlying cause of diabetic osteopenia, which may be targeted therapeutically.