Xorg/window manager fails on startup

On my new install of nixos, I boot a tty with the message that the xorg failed to load, and to prompt
systemctl status display-manager for details, which can be found here, along with my current configuration:

Fortunately, logging into the tty shell and simply running systemctl start display-manager boots me to lightdm. I read this xorg page in the nix wiki, but that doesn’t suggest to do anything I’m not already doing.

What system settings should I investigate?

1 Like

I’ve tested the following, which suggests to me that this is a trivial change somewhere in the configuration file having to do with starting the display-manager service.

After a nixos-rebuild switch && reboot, the display manager service fails to start.
Entering systemctl start display-manager starts lightdm.
Rebooting fails to start the display manager.
Entering systemctl enable display-manager, and rebooting successfully starts the display manager on startup.

The offending section, if there is one, seems likely to be in this section, though I note that
nixos-option services.xserver.enable and nixos-option services.xserver.displayManager.lightdm.enable both return true, both before and after a system rebuild/reboot.

  services.xserver.enable = true;
  services.xserver.displayManager.lightdm.enable = true;
  #services.xserver.displayManager.lightdm.background = "somepath";
  services.xserver.windowManager.stumpwm.enable = true;
  services.xserver.layout = "dvorak";
  services.xserver.xkbOptions = "ctrl:nocaps";
  services.xserver.libinput.enable = true; # Enable touchpad support

This also looks I’ve experimented with removing the lightdm line, which seems to be the default setting anyhow. What other things should I try?

clue-ish: on startup, after 2.5 seconds I get several errors:

nvidia-gpu 0000: i2c timeout error e0000000
ucsi_ccg i2c_transfer failed -110
[ OK ] Stopped X11 Server.
Starting X11 Server...
[ OK ] Started X11 Server
[ OK ] Stopped X11 Server.
Starting X11 Server...
[ OK ] Started X11 Server 
...some backlight drivrs load...
[ OK ] Stopped X11 Server.
[FAILED] Failed to start X11 Server
See 'systemctl status display-manager.service1 for details.

It’s weird that:

  1. the nvidia error happened, suggesting I should go look at nvidia-related wiki pages
  2. I’m not sure what the ucsi_ccg driver is, so I gave it a quick look, and found this post, which I’m going to give a shot, blacklisting the nvidia driver.
    This arch forum post suggests that the latter error is probably harmless though.

Those errors are harmless, it’s a red herring :slight_smile: I’ve been running X fine with them showing up for months now, it’s a known bug in the kernel with a fix here that somehow hasn’t made it into mainline yet: https://bugzilla.kernel.org/show_bug.cgi?id=206653#c19 (seems down at the minute, but whenever it comes back up…).

I struggle to recall context, but I think it was about attempting to load a certain driver for GPUs that don’t actually support it.

Given that Xorg fails, you probably want to look at the Xorg logs: journalctl -t xsession . Depending on your configuration other useful logs might live under /var/log/X and ~/.xsession-errors.

Thanks for saving me a goose chase then. It looks like .xsession-errors is empty, but I put up the results of journalctl and /var/log/X.0.log on my gists. Still looking through them, would be razzed if you’d care to take a look with me.

You seem to only share the last couple of lines of your log there, probably copied from out of the terminal? If you pipe the journalctl output to a file, it’ll skip the pager and dump the entire logs to a file:

journalctl -t xsession > file.txt

There may also be other log files in /var/log/X that’ll contain info from previous invocations. If you copy out just the 0 one it’ll be from the current session, i.e. probably the working one, which isn’t that useful here :wink:

Any reason you have network config there? I hope that PSK is censored.

because we’re all rushing to your address to log onto your wifi.

Fortunately, I do indeed censor my wifi passphrase, but come on over, Christmas LAN party at mine


:slight_smile: Mostly concerned about key reuse, but I was wondering why that was there and if you’d seen networking.wireless.networks.

if you setting you other passwords, to your wifi password, then you have other problems! :slight_smile:

Hi, I had the exact same problem and checking out what caused systemd to fail:

Process: 1190 ExecStart=/nix/store/hphsx5383075c6l7s4kvnkp9hmjww4gz-unit-script-display-manager-start/bin/display-manager-start

it just started lightdm as far as I could tell

#!/nix/store/dznl6xxx7bp9xynmsbrjjba9x726m3f9-bash-5.1-p8/bin/bash -e
export PATH=/nix/store/52yp9irkazd3157yas9vvg7s2p39s2b7-lightdm-1.30.0/sbin:$PATH
exec /nix/store/52yp9irkazd3157yas9vvg7s2p39s2b7-lightdm-1.30.0/sbin/lightdm

and changing the display-manager to sddm in my case solved the issue.

P.S. calling sudo lightdm –-test-mode --debug showed an error. However I forgot to save the output. But if you are interested, I can revert to lightdm and try to replicate the messaeg.

1 Like