Catalyzes the formation of UDP-glucose from glucose-1-phosphate and UTP. This is an intermediate step in the biosynthesis of diglucosyl-diacylglycerol (Glc2-DAG), i.e. the predominant glycolipid found in B.subtilis membrane, which is also used as a membrane anchor for lipoteichoic acid (LTA). Has a role in the biosynthesis of all phosphate-containing envelope polymers, since UDP-glucose serves as a glucosyl donor not only for the biosynthesis of LTA but also for wall teichoic acids (WTAs). Is required for biofilm formation. This is likely due to another role of UDP-glucose, which might also act as a metabolic signal regulating biofilm formation or may be involved in some unknown biosynthetic pathway essential for biofilm formation, e.g. the synthesis of an exopolysaccharide. alpha-D-glucose 1-phosphate + H(+) + UTP = diphosphate + UDP-alpha-D-glucose kcat is 1.06 sec(-1) with glucose-1-phosphate as substrate. kcat is 1.04 sec(-1) with UTP as substrate. Glycolipid metabolism; diglucosyl-diacylglycerol biosynthesis. Interacts with FloT. Present in detergent-resistant membrane (DRM) fractions that may be equivalent to eukaryotic membrane rafts; these rafts include proteins involved in signaling, molecule trafficking and protein secretion. By heat shock, salt stress, oxidative stress, glucose limitation and oxygen limitation. Expressed under control of the sigma-B transcription factor. Under aerobic growth condition, deletion mutants display morphological defects and the cells are curled and show some bulges (PubMed:33556370). No aberrant morphology is observed for the deletion mutants under anaerobic growth conditions (PubMed:33556370). GtaB is the main UGPase enzyme producing UDP-glucose under both aerobic and anaerobic fermentative growth conditions (PubMed:33556370). YngB augments UDP-glucose production under anaerobic growth conditions (PubMed:33556370). Belongs to the UDPGP type 2 family.