ONCF operates the Le Bouregreg urban rail for Rabat-Salé agglomeration. Rabat is well served by train and you can get frequent connections to most places. Marrakesh is a pleasant 4 hr journey, Fez 2½ hr (if you take one of the new express trains, and 3½ hr on other trains) and Casablanca 1 hr.