If yo intend to go south to western sahara you can get a ride on a Western Sahara old cargo truck. watch out and dont let yourself be killed..
Appart from the normal means of transportation you have ocasional transportation in trucks like this that usually only local people get, cheaper. If you see someone getting cargo on top of an old land cruiser defender like this, offer yourself to join them in a many hours journey going south. offer some money also.
You can get there by bus or grand taxi depending from where you are coming from actually. so you have to take in consideration that grand taxis going south to western sahara can transport you there from major cities.
From the gare routiere by BUS in Bou Izakarn road you have many destination off Guelmim. 86times a day you have buses going to agadir and 4 of them do actually keep on to marrakesh and casablanca. you have 4 buses to Tan Tan and 1 for Assa-Zag. If you prefer better quality buses you only have one CTM bus goign once a day to Casablanca at 8pm.
OUTSIDE CTM OFFICE you have ONCF services:
Going to Laayoune 12.30am continuing to Dakhla right on the south o western sahara, only +-400km from Mauritanian border. to marrakesh 930pm, 12am and 12.30am.
You have grand taxis going everywhere you money can buy but major connection are Agadir, Tan Tan, Layoune and Smara. During the night (10pm-6am) you get taxis outside the CTM office and during the day from the Gare Routiere.
Many bus companies can bring you to Marrakesh but the most reliable ones are CTM and Supratours. We also tried SATAS but after reading our experience in Essaouira, you'll understand why you'd better not travel with that company ;-)
In Guelmim, the CTM and Supratours offices are not located in the bus station itself but just across the street (avenue Abaynou). We chose Supratours because it was possible to travel by night. The bus was ok, we had a safe trip and arrived almost on time ;-)