Synopsis #
GNOME provides the desktop session; GDM provides graphical login. Both depend on working graphics and system services. Configure the graphics driver first, and keep a text console or SSH session available while testing.
Use a normal user account for the desktop.
Install and enable the services #
Install the minimal desktop, display manager, and Xorg:
# pkg install xorg gnome-lite gdm
Use gnome instead of gnome-lite for the larger set of GNOME applications. If the graphics driver requires membership in video, grant access to both the desktop user and GDM:
# pw groupmod video -m loginname
# pw groupmod video -m gdm
Replace loginname with the actual account and log in again after changing its groups.
Prepare the user’s Xorg session, replacing loginname with the actual account. As that user, copy the packaged session initialization file; merge it with an existing .xprofile rather than overwriting custom settings:
$ cp /usr/local/share/examples/gnome-shell/xprofile ~/.xprofile
As root, create the account-settings directory if needed:
# install -d /var/db/AccountsService/users
Create or update /var/db/AccountsService/users/loginname:
[User]
Language=en_US.UTF-8
Session=gnome-xorg
SystemAccount=false
Use the user’s preferred locale. The installed GNOME 47 packages support the gnome-xorg session; select GNOME on Xorg at login.
GNOME needs procfs. Add the following line to /etc/fstab if it is not already present:
proc /proc procfs rw 0 0
Mount it and start D-Bus before GDM:
# mount /proc
# sysrc dbus_enable=YES
# service dbus start
# sysrc gdm_enable=YES
# service gdm start
Disable another display manager, such as LightDM, before starting GDM. Do not run both. At the login screen, select the normal user, enter its password, and check that the desktop opens. Log out and back in, then reboot and confirm graphical login still works.
If the login screen does not appear #
From SSH or a text console, check the services, procfs, and logs:
# service dbus status
$ mount -t procfs
# pgrep -lf /usr/local/sbin/gdm
# tail -n 50 /var/log/messages
# ls -lt /var/log/gdm
Read the current GDM and Xorg logs, rather than an old log from a previous attempt. Driver load failures, unavailable screens, and permissions errors belong to graphics setup . Reinstalling GNOME does not fix those causes.
If login returns to the greeter #
Check that the user’s home directory exists, is writable by that user, and has free space:
$ id
$ ls -ld "$HOME"
$ df -h "$HOME"
Run these commands as the affected user. Check its session errors and the GDM logs for the failed login. Do not delete the user’s entire configuration directory as a first step.
Read the user’s session log if it exists:
$ tail -n 50 ~/.cache/gdm/session.log
To return to text login while investigating, disable GDM and reboot from the retained administrative session:
# sysrc gdm_enable=NO
# shutdown -r now