The chemical reactions and pathways involving glycolipids, a class of 1,2-di-O-acylglycerols joined at oxygen 3 by a glycosidic linkage to a carbohydrate part (usually a mono-, di- or tri-saccharide). Some substances classified as bacterial glycolipids have the sugar group acylated by one or more fatty acids and the glycerol group may be absent.