NixOS 22.05 GNOME ISO didn't put gnome-session in PATH

I’m installing NixOS for the first time, and I’m running into issues. This is on a System76 Darter Pro laptop.

I put the graphical installation ISO image for NixOS 22.05.1818.26fe7618c7e (with GNOME) on a USB stick, then booted from the image into the installer.

The installer couldn’t connect to the internet, so I ran nmtui to connect to my local WiFi, restarted the installer, then walked through it, having it replace my main partition and selecting GNOME as my desktop environment.

I rebooted, and was able to select NixOS at boot time:

image

It dropped me briefly at a tty prompt

then left me at tty7, which was just a blinking underscore (no prompt, no response to text entry).

Switching back to tty1 allowed me to login with the user I created at install time.

gnome-shell was in my path

but gnome-session is not, though it does appear in the local nix store

I’m sure, given time and a bit of research, I could manually alter /etc/nixos/configuration.nix to enable GNOME at startup and get the ball rolling, but I’m even more sure that that’s what the installer was supposed to do.

So before I go chasing post-installation fixes, I wanted to check if:

  • yes this is something the installer should have set up for me
  • was there something I should have done during the installation process differently to get it to work
  • should I report this as a bug somewhere

Running GNOME Shell using any other method than GDM is not supported on NixOS so it is not a surprise gnome-shell command does not work.

If you selected GNOME Shell in the installer, GDM should be installed and start automatically. So it is either a bug in the installer not adding GDM to your config, or the display manager itself crashes.

Try checking systemctl status display-manager.service and the systemd journal.

4 Likes

Thanks for the direction.

[rampion@nixos:~]$ systemctl status display-manager.service
● display-manager.service - X11 Server
     Loaded: loaded (/etc/systemd/system/display-manager.service; linked; vendor preset: enabled)
     Active: active (running) since Fri 2022-07-22 17:57:29 EDT; 1h 13min ago
    Process: 1061 ExecStartPre=/nix/store/sdcwb6q00y19r3wn4q525f3wn4q525f3w0prq82pz-unit-script-display-manager-pre-start/bin/display-manager-pre-start (code=exited, status=0/SUCCESS)
   Main PID: 1069 (gdm)
         IP: 0B in, 0B out
         IO: 3.0M read, 0B written
      Tasks: 3 (limit: 76974)
     Memory: 4.5M
        CPU: 97ms
     CGroup: /system.slice/display-manager.service
             └─1069 /nix/store/33hp7as4wqx2pcna4zs99a2g3iqi3b6j-gdm-42.0/bin/gdm

Jul 22 17:57:40 nixos gdm[1069]: Gdm: Child process -1210 was already dead
Jul 22 17:57:40 nixos gdm[1069]: Gdm: GdmDisplay: Session never register, failing
Jul 22 17:57:40 nixos gdm[1069]: Gdm: Child process -1210 was already dead
Jul 22 17:57:40 nixos gdm[1069]: Gdm: GdmDisplay: Session never register, failing
Jul 22 17:57:40 nixos gdm[1069]: Gdm: Child process -1216 was already dead
Jul 22 17:57:40 nixos gdm[1069]: Gdm: GdmDisplay: Session never register, failing
Jul 22 17:57:40 nixos gdm[1069]: Gdm: Child process -1216 was already dead
Jul 22 17:57:40 nixos gdm[1069]: Gdm: GdmDisplay: Session never register, failing
Jul 22 17:57:40 nixos gdm[1069]: Gdm: GdmLocalDisplayFactory: maximum number of X display failures reached: check X server log for errors
Jul 22 17:57:40 nixos gdm[1069]: Gdm: Child process -1222 was already dead

I’m going to track down the systemd journal and X server log next.

scrolled through a bunch of journalctl -b and found:

X.Org X Server 1.20.14
X Protocol Version 11, Revision 0
Build Operating System: Nix
Current Operating System: Linux nixos 5.15.55 #1-NixOS SMP Fri Jul 15 08:13:00 UTC 2022 x86_64
Kernel command line: initrd=\efi\nixos\h447qnz7vmy76y133r4hbr5xcgqw5ahs-initrd-linux-5.15.55-initrd.efi init=/nix/store/pnnv03faphbam50w8i3lw4kpskkl8774-nixos-system-nixos-22.05.1818.26fe7618c7e/init loglevel=4
Build Date: 15 December 2021  07:01:53PM

Current version of pixman: 0.38.4
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting
        (++) from command line), (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (?? unknown)

(II) Loader magic: 0x62cd40
(II) Module ABI versions:
        X.Org ANSI C Emulation: 0.4
        X.Org Video Driver: 24.1
        X.Org XInput driver : 24.1
        X.Org Server Extension : 10.0
(++) using VT number 7
(II) systemd-logind: took control of session /org/freedesktop/login1/session/c1
(--) PCI:*(0@0:2:0) 8086:46a6:1558:7716 rev 12, Mem @ 0x81000000/16777216, 0x90000000/268435456, I/O @ 0x00001000/64, BIOS @ 0x????????/131072
(WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
(II) "glx" will be loaded by default

(II) AMDGPU: Driver for AMD Radeon
        All GPUs supported by the amdgpu kernel driver
(II) NOUVEAU driver
(II) NOUVEAU driver for NVIDIA chipset families :
        RIVA TNT            (NV04)
        RIVA TNT2           (NV05)
        GeForce 256         (NV10)
        GeForce 2           (NV11, NV15)
        GeForce 4MX         (NV17, NV18)
        GeForce 3           (NV20)
        GeForce 4Ti         (NV25, NV28)
        GeForce FX          (NV3x)
        GeForce 6           (NV4x)
        GeForce 7           (G7x)
        GeForce 8           (G8x)
        GeForce 9           (G9x)
        GeForce GTX 2xx/3xx (GT2xx)
        GeForce GTX 4xx/5xx (GFxxx)
        GeForce GTX 6xx/7xx (GKxxx)
        GeForce GTX 9xx     (GMxxx)
        GeForce GTX 10xx    (GPxxx)
(II) modesetting: Driver for Modestting Kernel drivers: kms
(II) FBDev: driver for framebuffer: fbdev
(EE) open /dev/dri/card0: No such file or directory
(WW) Falling back to old probe method for modesetting
(EE) open /dev/dri/card0: No such file or directory
(II) Loading submodule "fbdevhw"
(II) LoadModule: "fbdevhw"
(II) Loading /nix/store/jxq0gx10r1y4rscqkjj6wcf4v8gdjnf2-xorg-server-1.20.14/lib/xorg/modules/libfbdevhw.so
(II) Module fbdevhw: vendor="X.Org Foundation"
        compiled or 1.20.14, module version = 0.0.2
        ABI class: X.Org Video Driver, version 24.1
(EE) Unable to find a valid framebuffer device
(WW) Falling back to old probe method for fbdev
(II) Loading submodule "fbdevhw"
(II) LoadModule: "fbdevhw"
(II) Loading /nix/store/jxq0gx10r1y4rscqkjj6wcf4v8gdjnf2-xorg-server-1.20.14/lib/xorg/modules/libfbdevhw.so
(II) Module fbdevhw: vendor="X.Org Foundation"
        compiled or 1.20.14, module version = 0.0.2
        ABI class: X.Org Video Driver, version 24.1
(EE) open /dev/fb0: Permission denied
(WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
(EE) Screen 0 deleted because of no matching config section.
(II) UnloadModule: "modesetting"
(EE) Screen 0 deleted because of no matching config section.
(II) UnloadModule: "fbdev"
(II) UnloadSubModule: "fbdevhw"
(EE) Device(s) detected, but none match those in the config file.
(EE)
Fatal server error:
(EE) no screens found(EE)
(EE)
Please consult the The X.Org foundation support
         at http://wiki.x.org
 for help.
(EE) Please also check the log file at "/dev/null" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
Unable to run X server

(Note the errors at the end)

(imagine that each of those lines was prefixed by

Jul 22 17:57:39 nixos /nix/store/33hp7as4wqx2pcna4zs99a2g3iqi3b6j-gdm-42.0/libexec/gdm-x-session[1194]:

)

After this is the same Gdm: GdmDisplay: Session never registered, failing message, so I think this is the key part of the log.

I don’t know what to do with this information, though.

These kinds of errors probably should only turn up if your drivers are broken, or something else is horribly wrong.

Can you share your /etc/nixos/configuration.nix and the hardware-configuration.nix next to it? Maybe the installer grabbed the wrong drivers or such.

I checked the specs, but just to confirm, this isn’t one of those multi gpu laptops, right?

2 Likes

Not unless they snuck another one in and didn’t tell me about it.

/etc/nixos/configuration.nix:

# Edit this configuration file to define what should be installed on
# your system.  Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running 'nixos-help').

{ config, pkgs, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];

  # Bootloader
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;
  boot.loader.efi.efiSysMountPoint = "/boot/efi";

  networking.hostName = "nixos"; # Define your hostname.
  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.

  # Configure network proxy if necessary
  # networking.proxy.default = "http://user:password@proxy:port/";
  # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

  # Enable networking
  networking.networkmanager.enable = true;

  # Set your time zone.
  time.timeZone = "America/New_York";

  # Select internationalisation properties.
  i18n.defaultLocale = "en_US.utf8";

  # Enable the X11 windowing system.
  services.xserver.enable = true;

  # Enable the GNOME Desktop Environment.
  services.xserver.displayManager.gdm.enable = true;
  services.xserver.desktopManager.gnome.enable = true;

  # Configure keymap in X11
  services.xserver = {
    layout = "us";
    xkbVariant = "";
  };

  # Enable CUPS to print documents.
  services.printing.enable = true;

  # Enable sound with pipewire.
  sound.enable = true;
  hardware.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    # If you want to use JACK applications, uncomment this
    #jack.enable = true

    # use the example session manager (no others are packaged yet so this is enabled by default,
    # no need to redefine it in your config for now)
    #media-session.enable = true;
  };

  # Enable touchpad support (enabled default in most desktopManager).
  # services.xserver.libinput.enable = true;

  # Define a user account. DOn't forget to set a password with 'passwd'.
  users.users.rampion = {
    isNormalUser = true;
    description = "Noah Luck Easterly";
    extraGroups = [ "networkmanager" "wheel" ];
    packages = with pkgs; [
      firefox
    #  thunderbird
    ];
  };

  # Allow unfree packages
  nixpkgs.config.allowUnfree = true;

  # List packages installed in system profile. To search, run:
  # $ nix search wget
  environment.systemPackages = with pkgs; [
  #  vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
  #  wget
  ];

  # Some programs need SUID wrappers, can be configured further or are
  # started in user sessions.
  # programs.mtr.enable = true;
  # programs.gnupg.agent = {
  #   enable = true;
  #   enableSSHSupport = true;
  # };

  # List services that you want to enable:

  # Enable the OpenSSH daemon.
  # services.openssh.enable = true;

  # Open ports in the firewall.
  # networking.firewall.allowedTCPPorts = [ ... ];
  # networking.firewall.allowedUDPPorts = [ ... ];
  # Or disable the firewall altogether.
  # networking.firewall.enable = false;

  # This value determines the NixOS release from which the default
  # settings for stateful data, like file locations and database versions
  # on your system were taken. It's perfectly fine and recommended to leave
  # this value at the release version of the first install of this system.
  # Before changing this value read the documentation for this option
  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  system.stateVersion = "22.05"; # Did you read the comment?

}

/etc/nixos/hardware-configuration.nix:

# Do not modify this file!  It was generated by 'nixos-generate-config'
# and may be overwritten by future invocations.  Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:

{
  imports =
    [ (modulesPath + "/installer/scan/not-detected.nix")
    ]

  boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ];
  boot.initrd.kernelModules = [ ];
  boot.kernelModules = [ "kvm-intel" ];
  boot.extraModulePackages = [ ];

  fileSystems."/" =
    { device = "/dev/disk/by-uuid/b0183fcb-885f-4543-9e45-d3bf519915bf";
      fsType = "ext4";
    };

  fileSystems."/boot/efi" =
    { device = "/dev/disk/by-uuid/8B3A-45BF";
      fsType = "vfat";
    };

  swapDevices = [ ];

  # Enables DHCP on each etherenet and wireless interface. In case of scripted networking
  # (the default) this is the recommended approach. When using systemd-networkd it's
  # still possible to use this option, but it's recommended to use it in conjunction
  # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
  networking.useDHCP = lib.mkdDefault true;
  # networking.interfaces.enp46s0.useDHCP = lib.mkDefault true;
  # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;

  powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

Try using the latest kernel, there were some more recent Xe Graphics support changes IIRC.

2 Likes

To save you some googling, you’d do that by changing boot.kernelPackages.

Add this to your configuration.nix:

And then you’d run sudo nixos-rebuild switch.

This is a bit annoying, makes it hard for new users to install NixOS on new hardware if they need to figure this out. I wonder if we can improve this somehow.

3 Likes

Awesome, that did it!

Thanks so much! I’m off to play with my newly functional NixOS install (and to read up on boot.kernelPackages and the rest of configuration.nix).

Y’all are wonderful.

3 Likes

I just had pretty much the same error in nixos-23.11.

In my case, the problem was a missing import of the machine’s hardware-configuration.nix after I rearranged my configuration modules.