Solved (1) Slim: "Failed to execute login command" & (2) Single user mode: "insufficient privileges"

Hello FreeBSD folks. I'm new to FreeBSD, but have installed (and experimented with) it over 50 times now (with Handbook "in hand") so I'm beginning to understand how it works. I think it's awesome! That said, I've hit a wall and need help.

Also, this is my first post. I have read the guidelines; nonetheless, I seem to learn via trial and error so please forgive my formatting mistakes.

Problem #1: My latest install boots into Slim successfully, but after correctly entering my username and password, it takes me to a screen that reads, "Failed to execute login command."

Background: I installed FreeBSD 13.1, the Spectrwm window manager, and the Slim display manager. To launch the latter two, I put exec spectrwm in my ~/.xinitrc file and slim_enable="YES" in my /etc/rc.conf file, respectively.

Theory: Having never encountered this problem with my usual display managers, SDDM or GDM, I imagine this has something to do with the slim.conf and/or /etc/rc.conf contents. That is, using Slim perhaps requires different preparation for launch than SDDM and GDM.

Research: I read up on Slim (which I failed to do beforehand, eesh) and this specific 'failed login' problem in this forum and found that perhaps it's necessary to put the full path to /usr/bin/spectrwm into ~/.xinitrc. Obviously, I can't validate the path, nor experiment with that idea, because I'm locked out.

Problem #2: In the hopes of solving this, perhaps by simply removing Slim and installing SDDM, I entered Single-user Mode and reached the Root prompt. I then attempted to load some files (via nano and cat and also to install SDDM, but no matter what command I entered, I continually received (something like), "you do not have sufficient privileges to install...etc."

Questions: (1) Other than simply removing Slim and installing SDDM, what is the right approach to solving the 'failed login' problem? And, (2) How/when could (logged-in) Root not have privileges, and how do I correct that problem?

I imagine these are very newb problems, but I look forward to the education.

Thank you!
You don't need to start in single mode.

Ctrl + Alt + F1 to switch to tty1.

Login as root and do your magic.

ee /etc/rc.conf (Esc for menu)

Add your user to wheel, video, operator with pw.

Use /home/user/.xinitrc to launch your window manager of choice.

service slim restart

Go back to tty1 to exit if all went well.

Ctrl + Alt + F9 to return to X (from tty).

I speak from memory, find the right syntax to use pw.

init 1 -- single user with restrictions (will drop you into a root
shell without asking for login)
init 3 -- same as init 2 but with networking enabled (useful for
mounting network shares while fixing stuff)
Thank you, CuatroTorres.

I neglected to mention above that when I press Crtl+Alt+F1 at the Slim login prompt, the screen goes black (with no prompt, nor text of any kind), and then the computer loses the HDMI connection. This is why I tried Single User Mode.

And, I did give myself group rights to the wheel video operator groups.

Any other ideas?
mount -o rw / in single user mode to change to read-write.

Also did you already install and configure a drm video driver like i915kms for your Xorg?

Any other ideas?
Comment out Slim settings and get startx running manually. Then add back Slim or SDDM settings..
When troubleshooting it is best to cut back to bare minimum. Then add features.
Thanks, Phishfry.

I did install the nvidia-driver-340 for my 2009 Mac Mini's legacy chip. And, I like your approach to first use startx to verify Xorg before enabling the display manager. Will do, henceforth.

The mount -r rw / command doesn't allow me to edit the relevant file. This is a ZFS filesystem so I did a search on correct mounting and found this forum reference.

The following was mentioned therein:

Basic single user mode stanza:
fsck -y         # Check filesystems for errors
mount -u /      # re-mount root as read/write
mount -a -u ufs # mount all UFS filesystems
swapon -a       # Enable swap

If it's a ZFS system you may need to run zfs mount -a. The mount -a command only works for filesystems that are in /etc/fstab (ZFS filesystems usually aren't).

I've tried variations of the above commands, but still cannot edit /etc/rc.conf.

Any thoughts on the correct commands and their order?
Okay, trying commands from the stanza above returned success.

Solution: mount -u / as Single User root allowed me to comment out slim_enable="YES" in /etc/rc.conf and then to start Xorg (to TWM) with startx.
Thanks for putting me on the right path, Phishfry (great name, btw 🎸), CuatroTorres, and covacat. Much appreciated! :D:beer: