Component of the viral envelope that plays a central role in virus morphogenesis and assembly via its interactions with other viral proteins. Homomultimer. Interacts with envelope E protein in the budding compartment of the host cell, which is located between endoplasmic reticulum and the Golgi complex. Forms a complex with HE and S proteins. Interacts with nucleocapsid N protein. This interaction probably participates in RNA packaging into the virus. Largely embedded in the lipid bilayer. Belongs to the alphacoronaviruses M protein family.