Probably involved in the osmoprotection via the biosynthesis of trehalose. Catalyzes the transfer of glucose from UDP-alpha-D-glucose (UDP-Glc) to D-glucose 6-phosphate (Glc-6-P) to form trehalose-6-phosphate. Acts with retention of the anomeric configuration of the UDP-sugar donor. D-glucose 6-phosphate + UDP-alpha-D-glucose = alpha,alpha-trehalose 6-phosphate + H(+) + UDP Glycan biosynthesis; trehalose biosynthesis. Homotetramer. Belongs to the glycosyltransferase 20 family.