SDDM & X11 on Slackware 14.201 September 2016
Although Slackware ships with KDE, I have found it rather heavyweight for my requirements, and without it installed Slackware falls back to XDM which does not support selection of sessions (i.e. window manager). Looking around, SDDM turned out to be the best bet, although getting it to work on Slackware is a bit of an ordeal. Incidentally, KDE v5 has adopted SDDM, but Slackware ships with KDE v4.
Most of the effort in getting a decent Slackware-based graphical login up and running is getting SDDM and all its dependencies built & installed, so I have also included a few non-SDDM bits as well. Knowledge of how to use SlackBuilds is assumed.
Unable to SSH in as rootMost of the experimentation done to find out the information here was done using a VirtualBox install, where it is more convenient to SSH in rather than login through the ‘GUI’, mainly due to the ability to cut-n-paste links. In OpenSSL v7 the defaults for root logins were tightened up, so in a fresh install logging into the root account using a password will not work. This is a good default for production systems but a pain when the system is an internet-isolated test box, particularly for a distribution that by default doesn't create user accounts during install. To re-enable root logins using passwords, in
/etc/ssh/sshd_configfind the following line:
and uncomment & change it to ‘yes’:
Afterwards you'll need to restart the SSH daemon (existing logins are not affected):
Unable to mount VirtualBox shared foldersUsing a shared folder on the host as a way to transfer data between VirtualBox hosts and guests is generally more convenient than using scp/sftp, but it can be a bit tricky to get working. You will need to build & install addons and kernel-addons from SlackBuilds. If trying to mount the shared folder in the guest results in this error:
/sbin/mount.vboxsf: mounting failed with the error: No such device
The problem is most likley the guest kernel driver for shared folders not being loaded, so load it using modprobe:
SDDM build dependenciesMy install of Slackware included everything except the TCL (Tcl/Tk), KDE, KDEI (KDE internationalisation), and Y (Games) disk-sets. This is pretty close to a complete install of Slackware, and I suspect most if not all of the below dependencies would need to be installed separately even if I did choose to install everything. For reference I've included the error messages associated with missing components.
Extra CMake modulesAlso known as ECM, this is a set of CMake modules used by the KDE developers for convenience purposes, but is also used in several other projects such as SDDM. I eventually found a standalone version (was v5.25.0 at time of drafting) via the Linux From Scratch project. From a brief experiment, this seems to be required even if you installed KDE.
unxz extra-cmake-modules-5.25.0.tar.xz tar -xvf extra-cmake-modules-5.25.0.tar cd extra-cmake-modules-5.25.0/ cmake . make make install
Error message if missing
CMake Error at CMakeLists.txt:36 (find_package): Could not find a package configuration file provided by "ECM" (requested version 1.4.0) with any of the following names: ECMConfig.cmake ecm-config.cmake Add the installation prefix of "ECM" to CMAKE_PREFIX_PATH or set "ECM_DIR" to a directory containing one of the above files. If "ECM" provides a separate development package or SDK, be sure it has been installed.
Linux PAM (Pluggable Authentication Modules)I'm not sure why Linux PAM is not a standard part of Slackware, but it is what SDDM uses to check login credentials.
wget http://www.linux-pam.org/library/Linux-PAM-1.3.0.tar.gz tar -xzvf Linux-PAM-1.3.0.tar.gz cd Linux-PAM-1.3.0 ./configure --disable-regenerate-docu make && make install
Error message if missing
CMake Error at cmake/FindPAM.cmake:70 (message): PAM was not found
PitfallsIf you leave out the
--disable-regenerate-docuconfigure script option you might get the following error:
/usr/bin/xmllint --nonet --xinclude --postvalid --noent --noout Linux-PAM_SAG.xml /usr/bin/xsltproc --stringparam generate.toc "book toc" \ --stringparam section.autolabel 1 \ --stringparam section.label.includes.component.label 1 \ --stringparam toc.max.depth 2 --xinclude --nonet \ http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl Linux-PAM_SAG.xml | /usr/bin/links -no-numbering -no-references -dump > Linux-PAM_SAG.txt Unknown option -no-numbering
Apparently this particular release version doesn't detect the presence of docbook in its configure script.
Qt 5Slackware comes with Qt4, but it seems that SDDM wants to build against Qt5, and I am not aware of any way of easily coaxing SDDM's build system to use Qt4. Annoying as Qt5 takes several hours to build even on fairly decent hardware (on a VM with three i5 cores and 4GB assigned, it took 5 hours 51 minutes), and will need around 4-5GB of space.
Build overviewAvailable via SlackBuilds. You will also need libxkbcommon via the same place.
Error message if missing
Could not find a package configuration file provided by "Qt5" (requested version 5.6.0) with any of the following names: Qt5Config.cmake qt5-config.cmake Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR" to a directory containing one of the above files. If "Qt5" provides a separate development package or SDK, be sure it has been installed.
Fetching, building, & installing SDDMI tried looking for release tarballs, but could not find any. I didn't check whether the Git repository had release tags/branches. Build process is easy enough once all the dependencies are in place though.
git clone https://github.com/sddm/sddm.git cd sddm mkdir build cd build cmake .. make && make install
Setting slackware to use SDDMIn Slackware, the runlevel 4 startup script (
/etc/rc.d/rc.4) looks for (in order) GDM, KDM, SDDM, and finally XDM. However, where it looks for SDDM is not where it gets installed, so this part:
# Look for SDDM as well: if [ -x /usr/bin/sddm ]; then exec /usr/bin/sddm fi
needs to be changed to:
# Look for SDDM as well: if [ -x /usr/local/bin/sddm ]; then exec /usr/local/bin/sddm fi
Selecting a SDDM themeBy default SDDM you select a user by icon, whereas I prefer a simple text field for username. This can be achieved by changing the SDDM theme to one that has such a layout. Themes are kept in
/usr/local/share/sddm/themes/, and the theme is selected by editing
[Theme] # Current theme name Current=elarun
‘Layout’ only allows selection of US keyboardOn the SDDM login screen, there is an option for changing keyboard layout, but it only lists ‘US’. To get it to show UK instead, in
setxkbmap "gb"(changing ‘gb’ to something else if you are not after the UK keyboard layout):
#!/bin/sh # Xsetup - run as root before the login dialog appears setxkbmap "gb"
If you want to have multiple keyboard layouts available, seperate them with commas (e.g.
"gb,us"). Credit for this trick is elsewhere.
All SDDM login attempts failingYou keep on entering the correct password, but cannot login via SDDM. Looking at
/var/log/sddm.logit is clear that PAM is denying permission:
[17:35:35.040] (II) HELPER: [PAM] Starting... [17:35:35.040] (II) HELPER: [PAM] Authenticating... [17:35:35.040] (WW) HELPER: [PAM] authenticate: Permission denied [17:35:35.040] (II) HELPER: [PAM] returning. [17:35:35.040] (II) HELPER: [PAM] Ended. [17:35:35.041] (WW) DAEMON: Authentication error: "Permission denied" [17:35:35.041] (WW) DAEMON: Auth: sddm-helper exited with 1
The tell-tale sign is the following appearing in
Slack142 sddm-helper: PAM _pam_load_conf_file: unable to open config for system-login Slack142 last message repeated 3 times Slack142 sddm-helper: PAM _pam_init_handlers: no default config other
The problem is SDDM is trying to use a non-existent authentication rule-set system-login, and can be fixed by putting something like the following into a new file named
#%PAM-1.0 auth required pam_unix.so shadow nullok auth required pam_nologin.so account required pam_unix.so password required pam_unix.so shadow nullok use_authtok session required pam_unix.so
Note: This particular ruleset has security issues (for instance it omits
pam_cracklib), but at least it is a starting point.
Adding IceWM to the SDDM session menuIn the past I have used
~/.xinitto load my long-time preferred window manager IceWM, but more recently I have also been using Xfce as well, so I now have a preference for being able to easily switch between the two. In both cases there is heavy customisation, so I am far from settling on a single choice. The SDDM sessions menu is populated using information from files within
/usr/share/xsessions, so to include IceWM you need to create a new file (e.g.
icewm.desktop) there with the following content:
[Desktop Entry] Version=1.0 Name=IceWM Session Comment=Use this session to run IceWM as your desktop environment exec=icewm-session Icon= Type=Application DesktopNames=ICEWM
Even though this is for IceWM, it should be trivial to adapt this for any other window manager. Check for rogue
~/.xinitrc files if things don't seem to be working as expected - this caught me out. I've also seen variants that instead use
tryexec=icewm-session but as far as SDDM is concerned it doesn't seem to make any difference.
Some non-SDDM bitsThese are not really SDDM-related, but they came up during the process of getting a Slackware graphical login up and running. I put them here for completeness rather than trying to spin them out into separate articles.
Getting the Xfce RedmondXP themeThis WindowsXP-like theme (and many others) is included with Xfwm for Fedora, but for some reason not Slackware, which has obsoleted its xfwm4-themes package. I found what looked like a git repository for a themes pack, so I just cloned it and copied in the theme I wanted:
git clone https://github.com/Distrotech/xfwm4-themes.git mkdir /usr/share/themes/WinXP mkdir /usr/share/themes/WinXP/xfwm4 cd xfwm4-themes/themes/redmondxp cp * /usr/share/themes/WinXP/xfwm4
Sleep & hibernate disabled for non-root usersIf Sleep, Hibernate, and/or Shutdown are greyed out on the Xfce logout dialog, in
Xfce logout hangsThis is most noticeable if you've only just logged in rather than waiting a while, and choose Logout from Xfce's logout dialog. It seems to just sit there, and if you try choosing logout again you get the following dialog with Session manager must be in idle state when requesting a shutdown. This problem seems more prevalent when using a virtual machine such as Virtualbox or KVM than bare-metal hardware:
There seems to be some link between this and not properly setting up the sddm user's home directory and group membership, as I got some of the GL errors that SDDM's installation docs mention. To configure these, use the following:
usermod -a -G video sddm usermod -d /var/log/sddm
Note: Leaving out the
-a will result in the user being removed from all groups except video - probably not what you want..
Getting Windows fonts into LinuxI had a bunch of fonts that started life as part of a System 7 era font pack that somehow got converted into Windows TrueType fonts using a long-forgotten tool and have managed to follow me around ever since. Anyway, assuming any Windows fonts you've got have been copied into
/usr/share/fonts/windowsyou need to create
/etc/fonts/local.confcontaining the following:
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <dir>/usr/share/fonts/windows</dir> </fontconfig>
You then probably need to run
fc-cache /usr/share/fonts/windows and you can check using
fc-list whether they are being picked up. Your Windows fonts should now be available in LibreOffice et al..
Installing ChromeGoogle Chrome isn't actually available for Slackware - you have to install the upstream open-source Chromium instead. Thankfully it is one of the packages that “alien” makes for Slackware, although it is much quicker get it from the Slackware.uk mirror.
Installing LibreOfficeThis requires the
kde-dev-scriptspackages to be installed if (like me) you decided not to install KDE. Otherwise it is just a case of following dependency instructions on SlackBuilds. Note that it will take a few hours, and the LibreOffice SlackBuild script will use about 12GB of space in