MDM lost 10 pounds
by clem 55

MDM is central in Linux Mint and at the crossroads of many important technologies, plymouth, bumblebee, upstart, consolekit, Xorg, DE sessions, screensavers… so it needs to work well but also to be easy to maintain.

Originally it was designed as GDM in 2007. At the time features which mattered (XDMCP, Xnest, Solaris support) don’t matter much anymore and new aspects have become very important (Interactive/dynamic UI, user switching, KISS setup tools, simple design). You’ve seen what we did with Mint since 2006, and more recently with projects such as Cinnamon. We’re getting good feedback and we’re very good at developing great software. For this to work though, we need to eliminate technical debt and remove anything that stands in the way of rapid development.

MDM features 3 greeters, 2 of which are themeable. GDM themes let people design themes easily, and HTML5 themes allow people to create interactive and dynamic login screens. As much as possible we want to give artists the ability to create great themes, for them to work reliably and for us to come up with new features and solutions without being restricted by old designs, complexity, and features we don’t need.

With this in mind some 24,500 lines of code were removed from MDM.

Of course that means we removed some features:

  • Remote login and XDMCP support
  • Xnest/Xephyr nesting
  • Server management
  • Dynamic servers
  • Custom commands
  • Solaris support
  • mdmphotosetup
  • Most non-KISS configuration options in mdmsetup (still configurable in /etc/mdm/mdm.conf)

That allowed us to drastically simplify the design:

  • Simpler communication protocol between the daemon and the slaves
  • No more protocol version checks
  • No more legacy support for old GDM protocols
  • Everything is now local so a lot of simplification all over the codebase

This simplification of MDM also has visual benefits. Although it might be considered a loss, being more selective with which options are graphically configurable in mdmsetup means the configuration tool for MDM is far less intimidating than before and much more user-friendly.

Capture du 2013-09-25 11:20:32

Capture du 2013-09-25 11:20:35

Capture du 2013-09-25 11:20:57

And already, this pays off in terms of design. Now… I’ll be honest here, most if not all Mint developers are still scared of MDM. But with these 24,500 lines of code removed, I was able to study the design and the various communication protocols used by MDM and I personally feel on top of things when it comes to maintenance now. Everywhere I look I see code we can simplify still, but already things are falling into place.

MDMFlexiServer for instance (which is the command used to interact with the daemon from the command line or to switch user) now has a very simple design. I was able to review it entirely and rewrite the way it works. Switching users (which complement the improvements made to user management and the user applet in Cinnamon 2.0), now works very well.

The ability to “Automatically select the last logged in user” is a feature people asked for for a while. We couldn’t easily implement it because ot the complexity of the MDM design. This is no longer a problem and this feature is now both functional and configurable.

Multi-monitor support is also something we want to fix. Again, a simpler design means we’ll be more efficient in troubleshooting bugs.

Looking forward at technologies such as systemd, wayland, mir, GPU drivers, we want to be able to be reactive, so it’s important for us to own MDM from A to Z, to understand its design fully and to have the flexibility to refactor it anytime the need arises.

55 thoughts on “MDM lost 10 pounds

  1. Reply Anand Sep 25, 2013 11:10

    Heartening news indeed, thanks Clem. Good riddance, as they say. :-)I was baffled by the MDM options earlier and was personally hoping for auto-previous user logged in. BTW, which theme are you running – looks elegant. :-) Wish – One should be able to invoke mdm-theme-emulator from MDM itself?

    I saw an 17 MB update via nightly PPA and updated it. I had it turned off earlier every day it was 5MB. Will check out if i have got new version.

    One doubt – Since you mentioned about bumblebee, in my laptop which has Nvidia Optimus Gx card and the default Cloud theme with flight simulator did not work though graphics card works fine. (optirun firefox http://webglsamples.googlecode.com/hg/aquarium/aquarium.html). Not sure if this if fixed now. Will give it a try.

    Also, I have posted this elsewhere as well, why cant Mint recommend bumblebee installation as part of their Additional drivers sugestion. I recently installed on my friends laptop which has same config and was hoping that it would suggest automatically. Poor pure desktop users would have no clue on bumblebee project especially who come from Windows world and is not even available as part of Software Manager. Is it that bumblebee software is considered unstable? I feel this is important else it could pose power mgmt issues as I have read elsewhere.

    Apologies for the long post.

  2. Reply Rüssel Sep 25, 2013 12:51

    Thanks for the MDM info, Clem.
    I would like to use HTML5 themes, but experienced greeter crashes so often that I abandoned these themes. The bug is described in
    https://bugs.launchpad.net/linuxmint/+bug/1185540
    I would be really happy if this bug is fixed in Linux Mint 16.

    • Reply Kirk M Sep 25, 2013 14:45

      I can confirm this and added my two cents on the bug report you referenced. I should mention that I’m running the Cinnamon Nightly PPA on LM 15/Cinnamon so I haven’t had time to test the new “slimmed down” version of MDM. The greeter crash happens less frequently of late but it still happens. It should probably be looked into before Linux Mint 16′s release?

  3. Reply Sambath Kumar Sep 25, 2013 13:07

    Amazing Results.. From Natty Pangolin we had started to use linux mint. Cant wait for next release…

  4. Reply Kirk M Sep 25, 2013 14:49

    I love it when code is slimmed down, especially if it’s well done. I take it that the new slimmed down MDM should be in the Cinnamon Nightly PPA within the next few days for those of us who live dangerously can test it?

  5. Reply Rehdon Sep 25, 2013 15:52

    I never thought about a “Automatically select the last logged in user” feature, but now that I know about it I’m very happy you implemented it :)

    Good work LM team!

  6. Reply GamingOnLinux.com Sep 25, 2013 17:46

    Isn’t remove login a pretty big feature for companies? I hope that one has been thought through.

  7. Reply GamingOnLinux.com Sep 25, 2013 17:47

    Remote login* i meant that of course heh typo.

    • Reply reaktor Sep 25, 2013 21:41

      This exactly… :(

    • Reply clem Sep 26, 2013 08:30

      Yes, it’s been thought through a lot :)

      There’s a lot of problems with XDMCP:

      - In terms of maintenance for MDM it’s huge… it means the daemon and the client aren’t necessarily on the same machine (so everywhere you look in the code MDM not only asks itself whether it should do this a certain way because it’s local, or this another way because it’s talking to a remote MDM, but also check the protocol version and handle an enormous amount of special cases to make sure the two instances are compatible).

      - In terms of security, passwords typed over XDMCP go through the network in clear. Anyone who knows how to listen to activity on the network can get people’s passwords.

      - In terms of performance, XDMCP doesn’t compress anything.. it uses a lot of bandwidth on the network.

      - In terms of testing. We don’t necessarily want to feature something in Linux Mint if it isn’t properly tested. XDMCP definitely falls into that category. There’s no upstream for MDM, so we’re responsible for it. When it comes to its XDMCP support, not only aren’t we focused on it, it comes with a lot of technical debt and we don’t often have the setup to test and replicate issues.

      - There are better alternatives to XDMCP. Nomachine NX for instance compresses the data and tunnels it over ssh, so it’s both faster and more secure than XDMCP. FreeNX is another alternatives.

      • Reply Reorx Sep 27, 2013 14:58

        Don’t know if this is exactly “doable” but, for future versions, might it be possible to make the remote login feature an “add-on” (plug in, external call, etc.) package which could be installed by those who want/need it? This way you could keep the core code for MDM KISS but yet still allow the few who want this feature to add it.

        • Reply kneekoo Oct 1, 2013 16:53

          Remote login is quite important for some people and an add-on for it would be great. But I prefer removing all the clutter and let the Mint developers strengthen MDM before they start working on such an add-on. :) We can easily use an alternative DM if we must, so the current status, that applies to the needs of most people, seems just great. :D Great work, guys!

  8. Reply hellofu Sep 25, 2013 23:13

    hi mint team, i have been wondering what your thoughts where on wayland? if you plan to move over off x11 any times soon. it would make nice blog post to talk about your plans and how its affecting cinnamon and linux mint.

    sorry for being off topic you just mentioned mdm supporting wayland.

    • Reply clem Sep 26, 2013 08:37

      Hi,

      We’ll have no plans regarding Wayland or Mir until they’re fully stable and allow people to use their computer just as well as under Xorg. That means supporting all the common use cases such as video playback, acceleration in gaming, full compatibility with existing common toolkits such as Java, GTK2, etc.

      We’re excited about both projects and we wish them luck in getting to that stage where we’ll consider them as viable alternatives. Until then we’re pretty happy with Xorg.

  9. Reply Crewp Sep 25, 2013 23:53

    Clem, thanks and keep up the good work.

  10. Reply Ty Sep 26, 2013 04:15

    I’m disappointed with remote login being removed as I found it to be a very convenient one step way to login to other computers when I needed gui.
    Besides that, this all looks really great (especially with the recent nemo updates!)

    • Reply kneekoo Oct 1, 2013 16:57

      I know how that feels. Every once in a while I actually need remote login and for home use, not inside a company. But until an officially add-on will be supported I will simply use a VNC-based solution.

  11. Reply Richard Sep 26, 2013 08:33

    Glad this is being sorted out – this has always felt a bit clunky in Mint.

    Feature request though: can we have an “always set numlock on login screen” option? When entering a password containing a sequence of numbers it’s often easier to use the numeric keypad, and it currently always seems to default to numlock off on the login screen.

    • Reply clem Sep 26, 2013 09:13

      Good idea. Not sure it needs to be configurable (worst case scenario one can edit /etc/mdm/Init/Default) but I’ve set NUMLOCK as default now.

      • Reply clem Sep 26, 2013 09:23

        Update: Looking into this.. I spoke too fast. This will have to be OFF by default (many laptop constructors are providing their customers with keyboards where num_lock actually changes some of the char keys to numbers…). I’ll add an option for this in mdmsetup.

  12. Reply Anand Sep 26, 2013 10:28

    I am waiting for my comment to appear. :-) I guess it is under Moderation. To my knowledge there is no offensive content. Perhaps I digressed a wee bit and is long-winded.

  13. Reply kelebek333 Sep 27, 2013 11:38

    Could you add a resolution option on MDM Setup.

  14. Reply Tony Whelan Sep 27, 2013 21:26

    Re “Automatically select the last logged in user”. This is a great idea, its the one thing I liked about Ubuntu Unity’s login screen.

    On my test machine (LM 15 Cinnamon with nightly updates) this feature doesn’t appear to be working yet (though I have enabled it in the MDM preferences). But I know its early days yet.

  15. Reply Tony Whelan Sep 27, 2013 22:35

    Some feedback about “Automatically select the last logged in user”. Hope its ok to post them here. I observe the following problem behaviours:

    (a) The system only appears to remember the last logged-in user if you shut down. If you just log out, it does not pre-select the last logged-in user, and asks for a username.

    (b) When the new facility does remember the last user and prompts automatically for a password, it fails with a message “Incorrect username or password”. This only seems to happen if the user’s Full Name (not username) has a capital letter or a space in it. So a Full Name of “myname” works but “My Name” or “my name” do not. The new routine seems to be looking at Full Name field rather than Username field?

    (c) When MDM does prompt for a password for the last logged in user, and there are multiple users defined, there is no indication which user it is trying to log in. I’d think we need to have the last logged-in user highlighted in the list, otherwise a person trying to log in to a shared computer has no idea who last logged in and will potentially be entering a password for the wrong user.

    cheers

    • Reply clem Sep 30, 2013 08:55

      Hi Tony,

      a) It’s using the command “last”. Check that this command is working properly for you. To be precise it runs “last | grep tty | head -1 | awk {‘print $1;’}”.

      b) That’s very weird… again check that “last” command. Maybe it works differently in your distribution and we need to support that? Here in Mint, it lists the username first.

      c) That’s down to themeing. MDM tells the theme to select the user, it’s the theme’s responsibility to show that info to the user. Now, bear in mind, some of the themes we shipped in Mint 15 aren’t updated to support this yet.

      • Reply Tony Whelan Sep 30, 2013 12:08

        Hi Clem

        I’m testing this on clean install of Mint 15 Cinnamon, obviously with ppa added to get cinnamon nightlies.

        I created 4 test accounts with usernames of testuser1, testuser2, testuser3 and testuser4. After I had logged in with each of those, the history shown by the ‘last’ command had identical usernames (all of them truncated to ‘testuser’).

        So I then created a shorter username “user7″ and logged in with that. Then logged off but it did NOT remember the username when the login screen reappeared.

        I then rebooted and it then “remembered” the last user (user7) but this time it successfully accepted the password.

        So I think that the facility only works when you reboot (not just log out), and then only with usernames of 8 or less characters. If you use ‘last -w’ it shows the full usernames so perhaps the code should use “last -w | grep tty | head -1 | awk {'print $1;'}

        Re Themes, I understand what you’ve explained. I changed the theme from Clouds HTML to a GDM theme “SimpleUserList” and yes, after I rebooted it did correctly highlight the “last” user and prompted for their password.

        • Reply clem Sep 30, 2013 15:47

          Brilliant. Looks like you saved us from a nice nightmear by finding this early. I added -w to the last command and updated mdm in git.

          • Reply Tony Whelan Oct 1, 2013 08:17

            Thanks Clem, just tried it, and yes MDM 1.3.4 now behaves nicely with user names that exceed 8 characters.

            Do we know why the feature only “selects” the last logged-in user when you reboot, but doesn’t do so when you simply log off? I don’t think its a big deal but it seems strange that it does that. But then MDM seems to be a complex beast even with all those lines of code removed!

  16. Reply Tony Whelan Sep 29, 2013 08:06

    Clem, while its great to see enhancements of MDM, the point of having a username and password to achieve security of a machine is rather undermined because the automatic screen lock in Mint’s “Screensaver & Lock Settings” does not work properly.

    I reported it at bugs.launchpad.net #1209502 on 8 Aug but it doesn’t seem to be getting any attention. I see it as a fairly worrying security risk.

    regards

  17. Reply Kirk M Sep 29, 2013 15:00

    The new version of MDM is installed (updated) via the nightly PPA in both Linux mint 15 installs in my laptop (32 bit) and my desktop (64 bit) and both are running without a problem–nicley done.

  18. Reply Tony Whelan Sep 30, 2013 03:54

    A PS to my comment above re the timed screen lock not working in LM 15 Cinnamon on my PC. I just replicated the same bug on three other physical machines, one with Ubuntu 13.04 plus Cinnamon, one with Ubuntu 13.10 beta2 and Unity, and one with Elementary OS Luna (based on Ubuntu).

    Irrespective of whether a machine is running gnome-screensaver or cinnamon-screensaver, the timed screen lock does not operate in the way one would expect.

    1. If you don’t set the screen to turn off, then the timed locking function will NEVER work.

    2. If you do set the screen to turn off, and set the lock delay to a specific time, that time starts AFTER the screen turns off. So for example if you set screen off after 1 minute of inactivity and lock on after 1 minute, the lock will happen after a total of TWO minutes of inactivity.

    This is presumably an issue with gnome-screensaver (and I guess cinnamon-screensaver uses much of the same code).

    This interface needs to be redesigned so that one can have a timed automatic lock independent of whether or not the screen is set to turn off.

  19. Reply Tony Whelan Sep 30, 2013 04:23

    I just discovered GitHub a few minutes ago. Above screen lock problem logged as GitHub Issue #2403.

  20. Reply samriggs Sep 30, 2013 11:00

    24,500 lines of code removed WOW!
    good move on that one :)
    Hey Clem if you get a deb for lmde for the new mdm, can you let me know so I can add the changes you requested in the forum, I wouldn’t mind testing them out before putting them up.
    I like the changes being made to it.
    If you don’t want to put it live for everyone you can me about it instead.
    Working on another one :)
    Sam

  21. Reply Anand Sep 30, 2013 12:14

    Clem – I am aware that MDM is not just for Cinnamon but I think mdmsetup should be integrated and be part of Cinnamon System Settings. I remember when LightDM was introduced for KDE a few months ago, they added it to KDE System settings along with KDM.

    Also, even to change a theme does one need sudo rights? I am not sure if this was posted and replied elsewhere – any plans of adding MDM themes to Spices framework. Further, to encourage developers / artists to create and refine themes, some sort of reward mechanism (noit necessarily monetary) should be in place? Right now, i think, only samriggs plus handful of developers have created HTML themes.

    • Reply samriggs Sep 30, 2013 19:42

      No reward needed on my end at all, I just do it for enjoyment purposes and gives something back.
      The only thing I think scares off potential artist from making some is they have the ideas and art skills needed but lack the coding skills and want a very simple template so they basically don’t have to any coding at all or only basic html which won’t work out since all animations are in javascript or css, even though it wouldn’t take long to learn the css animation parts (took me the same day as I was creating the first one but I already knew some coding)
      It might be better to look for web developers or get them to team up with artist (which can create some really amazing work if they work well together) maybe a mdm community team for creating projets, we had that with flash/php years ago for creating projects like chat rooms and forum etc and it worked well for us back then, we all contributed something to it to make them better.
      The only thing I can suggest for others that have art skills and don’t want to take the time to learn the coding side (even though it wouldn’t take long and can be pretty simple for most of it) is to take a theme that has already been created and just change the name and artwork to make a new design for it (just like most do with cinnamon, gtk/metacity themes) that would work for them, maybe as more themes get created with different layouts more will jump on board and just start changing the artwork around :) well hopefully that’ll be the case.
      Sam

      • Reply samriggs Sep 30, 2013 21:51

        Another suggestion that might draw other mdm developers to the table is a place to upload their creations, like the cinnamon themes and applets, extensions etc at http://cinnamon-spices.linuxmint.com/themes

        Adding a section here for mdm themes might draw others
        Although the size requirement would have to be increased because some of the themes (mine lol, probably others as well) can be heavy in the graphic file sizes, or at least a showcase section here where we could also add a link where we they could download it (just have to kill the spammers).
        A lot of folks go there to check out cinnamon themes and through this, create their own creations which creates more themes, but if they don’t know where to go to check out themes or where to get them from (except from one thread in a forum) then it will get lost in the shuffle and draw less folks to making them.
        Just a suggestion
        Sam

  22. Reply Reorx Sep 30, 2013 16:06

    MDM – the Mint Display manager… I know that it got its name owing to its origin – GDM… but to casual observer, the name is counter-intuitive… MDM doesn’t really manage the display, it manages the login screen. I would like to suggest renaming MDM to MLM – the Mint Login Manager – it is a more accurate description and intuitive (more KISS)… Begging the forgivness of GDM of course…

    - R -

    P.S.: Thankfully, the folks making changes in MDM that use the GUI don’t seen the name at all and the menu item is called Login something (Login Window on LM13C64). ;-)

  23. Reply Andrei Oct 4, 2013 13:42

    Hello Clem,

    I must say that your doing a GREAT JOB, and I would like to ask if it’s possible for you to fork into cinnamon a password manager like SeaHorse, the gnome-user-share package that could share on the network the Public folder and if needed also other custom folders, would be great to have a cinnamon-user-share, with this features, also would be just awesome to have a fork of vino and vinagre remote desktop into cinnamon, I ve seen that you did a great job with mint display manager, would be possible to implement a VNC enable button, in order to log in remotely directly into the Mint Display Manager if needed, without messing around with configuration files and sometime useless tutorials.

    Thanks a lot for the good stuff you’re doing, let me know if I can help.

    Best regards,
    Andrei

  24. Reply jesse5567 Oct 6, 2013 08:43

    Reorx, you have a point. However, in traditional Unix terminology:

    “A set of screens for a single user with one keyboard and one pointer (usually a mouse) is called a display.”
    – _Xlib Programming Manual_, Chapter 1

    • Reply Reorx Oct 9, 2013 20:44

      Jesse;

      I get the historical reference… but a set of screens disigned to facilitate a single activity is frequently (commonly) referred to as a fill-in-the-blank (activity or thing) manager… Think about the file manager, update manager, archive manager, software manager, package manager, upload manager, etc. Arguably they could ALL (according to the Xlib programming manual) be called “display manager”… while that might be technically correct it doesn’t seem like the right thing to do… ergo the functionally descriptive names… I guess that there are other ways to look at things besides the Xlib prog man way… What I am suggesting has more to do with function than programming… although I appreciate that there is something to be said for both schools of thought on this… I look at this sort of thing from a user’s point of view rather that a programer’s…

      Cheers!

      • Reply clem Oct 9, 2013 23:02

        You’re right to question this and you’re right to look at it from a user point of view. If it was to be named appropriately it would surely be something like the “Login Screen” or “Login Manager”… and note that’s roughly what it’s called when you look at it in the menu.

        Now, historically.. when people started their Linux box they were getting into a tty console. From there they’d typically log in and if they wanted a graphical display they’d type “startx”. As you can see, each user, on his or her console (remember Unix takes its roots from a multi-user environment where people are often using terminals connected to a central server) manages his/her own display.

        Then one day, somebody coded something which was able to open displays for people, without them having to do it themselves. Rather than asking people to log in and start their own display… that thing would start displays for them directly (and in the process log them in as well, although the real novelty here was the management of the display).

        So there was XDM… the thing that was managing X11 displays (X11 Display Manager).

        At the time the name was very appropriate and even if nowadays we regard and use Linux very differently, Linux users have grown accustomed to understanding common terms such as DE, WM, DM.. etc. Most DMs actually call themselves somethingDM… MDM, GDM, LXDM, LightDM, KDM etc..

        My opinion on this is that the project and package name don’t matter. They should be unique, but wherever the tool is described to the user, primarily in the window titles of its graphical interfaces and in its menu items, there we should give it a generic name that is easy to understand.

        So the same way mintinstall is shown as Software Manager, mdm is shown as Login Screen.

      • Reply jesse5567 Oct 14, 2013 19:05

        Reorx,

        I disagree with you (or simply don’t understand) about your list of managers being able to be called display managers. A file manager manages files, not a keyboard, mouse and monitor(s).

        About your original point, though, like I said, you have a point. And I agree with that point 100%. (Perhaps I should have begun with that in my original comment.) A new user to *nix will not know the historical definition of display. And since the main purpose of the DM (from the user’s perspective) is to log you in, a Login Manager sounds much more reasonable. I think Clem’s “described to the user” point is particularly apt; documentation would begin to describe the DM as a login mechanism.

        It’s like saying to a teenager, “Roll up the car window.” Roll it? In all likelihood, he’s pressing a button or pushing a lever.

        I remember years ago asking my teenage (maybe he was younger) nephew if he knew what a turntable was. To his credit and my surprise, he did! ;)

        Of course, ask a kid today about Edgar Winter’s “Frankenstein” (currently playing on my turntable :) and you’d probably hear, “I never saw that movie. Is that based on a book?”

  25. Reply Alfred Haines Oct 6, 2013 22:00

    I like MDM the way I found it and thank you for your great work. BUT ..

    NO Remote login and XDMCP support!!!!!

    How do I lock the current version before it turns to crap?

    This is not weight loss it is a lobotomy.

    I may be new to Mint and MDM but these are the things that I installed it for. I have several teens and Mint has made my life a little simpler but a central server for files and media is my dream distro. Can we maybe look at ways to improve remote access not kill it.

    • Reply clem Oct 7, 2013 11:56

      Alfred, there are many ways which work better than MDM for remote login. I personally use NX and find it very handy.

  26. Reply Alejandro Nova Oct 7, 2013 14:48

    Is it possible to use MDM to run KDE? KDM has been declared dead by upstream, and KDE 5 will wipe it from the face of the Earth.

  27. Reply Anand Oct 8, 2013 11:51

    Yes, I have been running MDM on Mint 13 KDE, which originally came with KDM (later even LightDM was also available through kubuntu backport).
    Just install MDM and then type the below command to change the login manager.

    sudo dpkg-reconfigure kdm

  28. Reply Gordon Eldridge Dec 1, 2013 05:43

    Clem, I have been with Mint for a lot of years and have enjoyed every one of them! I just have a question about the differences between 15 and 16. I have been using the RC for a little while and noticed that there are far less login themes available in it, will this be fixed with the final or are you backing away from html 5 login themse? I really enjoyed those in Mint 15, all of my friends thought they were cool too.

    Gordon Eldridge
    Mint user since Mint 5

  29. Reply Amit Jan 29, 2014 05:14

    The new login manager looks awesome. Congrats guys!

Leave a Reply