Want a GUI -- most "how to" search results poor/wrong

I've been away from the various *BSD for a while but decided I wanted to try some development work in FreeBSD.
I'd like to do that dev. work in a desktop installation running as a guest under VMware Fusion (on MacOS).
So I downloaded 12.2 and installed in a new VM. Installation went mostly OK (though I naively tried to install for UEFI BIOS which had problems -- no biggie). That gave me a familiar BSD looking shell. So... how to get a graphical login? Some web searching...

The results pointed many different directions based on whether one prefers KDE, Gnome, Mate, etc. Personally I'm more familiar with Gnome 2 (now Mate) and most instructions for that suggested:

pkg install xorg mate slim
And add to /etc/rc.conf

After a reboot, that gave me a login screen, but attempts to logon fail (even with a correct p/w).
Further searching suggests creating a $HOME/.xinitrc containing "exec mate-session"...
which I happen to know is really not the right way to be doing that...

So I look around some more and see that a lot of my search results were quite old (2015 or so) and that the "slim" display manager is no longer being maintained, etc. On another system I use, I have mate + lightDM so I thought I'd try that. Very few of my search results suggested that, and only a couple hinted at how to do it, but with some experiments I came up with:

(Note: Already installed "xorg" and "mate" above.)
pkg delete slim
pkg install lightdm lightdm-gtk-greeter
and replace the "slim" line of rc.conf so the end looks like:

After that, login works as expected (and no, it's not necessary to create a $HOME/.xinitrc nor should it be necessary).
I will say that the "slim" greeter was more attractive, but I'm pretty sure that's only because nobody has added any branding stuff (eg. default background) to the lightDM greeter. Maybe I'll try doing so...

Anyway, I hope this note shows up in the search results of the next person looking for a "mate" installation.

Lastly, let me say "Thanks!" -- these are minor documentation problems. The important things all work.


Staff member
Still use SLiM myself. It might not be maintained anymore it still works perfectly. Install the x11-themes/slim-themes and set current_theme in slim.conf to fbsd. Then you'll have a nice looking FreeBSD "branded" login ;)

SLiM does require a ~/.xinitrc, this should do it:
[ -n "$1" ] && [ -x "$1" ] && exec "$1"
The reason is that SLiM allows you to switch which desktop manager or window manager you want, just hit the F1 button on the login screen to cycle through the ones you have installed. The fancy ~/.xinitrc will then automatically run the correct application for the chosen desktop/window manager. That'll also make it easier to install various different ones, so you can try them all.


My comment about $HOME/.xinitrc was just meant to point out that it's supposed to be optional, and if not present some system-wide default is supposed to be selected or offered. With lightDM that happens via:
I gather lightDM has ways to offer choices during login etc. though I'm not familiar with the details.
My two cents: I can start the gui myself after logging in, don't need a graphical login. So I just install xorg-minimal, xfce and then do startxfce4 after logging in.
I don't understand why people are bothering with DM if they only run only one DE. If you want that your DE to run after the login all is need is the following code in your shell rc:
 if [ $( /usr/bin/tty ) = "/dev/ttyv0" ]; then
Not brave enough for entering one line for each WM,DE in ~/.xinitrc and commenting all but one of his choice.