Skip to content

nixos/console: start vconsole-setup service after local-fs.target #430883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JohnRTitor
Copy link
Member

@JohnRTitor JohnRTitor commented Aug 4, 2025

This fixes the instances where the service might have trouble accessing custom fonts on disk.

May 17 19:48:23 Ainz-NIX systemd-vconsole-setup[901]: popen: /nix/store/hragmx5p3izmwinv4441hj5706sxy4xs-gzip-1.13/bin/gzip -d -c /etc/kbd/keymaps/i386/qwerty/us.map.gz: No such file or directory
May 17 19:48:23 Ainz-NIX systemd-vconsole-setup[901]: popen: /nix/store/hragmx5p3izmwinv4441hj5706sxy4xs-gzip-1.13/bin/gzip -d -c /nix/store/bjzji701dz67bfrrwx9smqqyy1pnf2c9-kbd-2.6.4/share/keymaps/i386/qwerty/us.map.gz: No such file or directory
May 17 19:48:23 Ainz-NIX systemd-vconsole-setup[901]: loadkeys: Unable to open file: us: No such file or directory
May 17 19:48:22 Ainz-NIX systemd-vconsole-setup[832]: /nix/store/bjzji701dz67bfrrwx9smqqyy1pnf2c9-kbd-2.6.4/bin/loadkeys failed with exit status 1.
May 17 19:48:22 Ainz-NIX systemd-vconsole-setup[832]: KD_FONT_OP_GET failed while trying to get the font metadata: Invalid argument
May 17 19:48:22 Ainz-NIX systemd-vconsole-setup[832]: Fonts will not be copied to remaining consoles
May 17 19:48:22 Ainz-NIX systemd[1]: systemd-vconsole-setup.service: Main process exited, code=exited, status=1/FAILURE
May 17 19:48:22 Ainz-NIX systemd[1]: systemd-vconsole-setup.service: Failed with result 'exit-code'.

Fixes #312452

Suggested by @fzakaria on Discourse.

With this fix applied:

❯  journalctl -b | grep Console  
Aug 04 16:00:58 Ainz-NIX kernel: Console: colour dummy device 80x25
Aug 04 16:00:58 Ainz-NIX kernel: Console: switching to colour frame buffer device 240x67
Aug 04 16:00:58 Ainz-NIX kernel: Console: switching to colour dummy device 80x25
Aug 04 16:00:58 Ainz-NIX kernel: Console: switching to colour frame buffer device 240x67
Aug 04 16:00:58 Ainz-NIX systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
Aug 04 16:00:59 Ainz-NIX systemd[1]: Starting Virtual Console Setup...
Aug 04 16:00:59 Ainz-NIX systemd[1]: Finished Virtual Console Setup.

Things done

  • Tested, as applicable:
    • [NixOS tests] in [nixos/tests].
    • Tested with my configuration

Add a 👍 reaction to pull requests you find important.

This fixes the instances where the service might have trouble accessing custom fonts on disk.

```
May 17 19:48:23 Ainz-NIX systemd-vconsole-setup[901]: popen: /nix/store/hragmx5p3izmwinv4441hj5706sxy4xs-gzip-1.13/bin/gzip -d -c /etc/kbd/keymaps/i386/qwerty/us.map.gz: No such file or directory
May 17 19:48:23 Ainz-NIX systemd-vconsole-setup[901]: popen: /nix/store/hragmx5p3izmwinv4441hj5706sxy4xs-gzip-1.13/bin/gzip -d -c /nix/store/bjzji701dz67bfrrwx9smqqyy1pnf2c9-kbd-2.6.4/share/keymaps/i386/qwerty/us.map.gz: No such file or directory
May 17 19:48:23 Ainz-NIX systemd-vconsole-setup[901]: loadkeys: Unable to open file: us: No such file or directory
May 17 19:48:22 Ainz-NIX systemd-vconsole-setup[832]: /nix/store/bjzji701dz67bfrrwx9smqqyy1pnf2c9-kbd-2.6.4/bin/loadkeys failed with exit status 1.
May 17 19:48:22 Ainz-NIX systemd-vconsole-setup[832]: KD_FONT_OP_GET failed while trying to get the font metadata: Invalid argument
May 17 19:48:22 Ainz-NIX systemd-vconsole-setup[832]: Fonts will not be copied to remaining consoles
May 17 19:48:22 Ainz-NIX systemd[1]: systemd-vconsole-setup.service: Main process exited, code=exited, status=1/FAILURE
May 17 19:48:22 Ainz-NIX systemd[1]: systemd-vconsole-setup.service: Failed with result 'exit-code'.
```

Fixes NixOS#312452
@JohnRTitor JohnRTitor requested a review from a team August 4, 2025 10:50
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/systemd-1-failed-to-start-virtual-console-setup/44798/8

@JohnRTitor
Copy link
Member Author

JohnRTitor commented Aug 4, 2025

@JaKooLit you may consider disabling the masking and use this fix in your configuration.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Aug 4, 2025
@rnhmjoj
Copy link
Contributor

rnhmjoj commented Aug 4, 2025

Is this with boot.initrd.systemd.enable = true? Otherwise I find it hard to believe the system could boot up to this point without a functioning /nix/store:

[...] /nix/store/bjzji701dz67bfrrwx9smqqyy1pnf2c9-kbd-2.6.4/share/keymaps/i386/qwerty/us.map.gz: No such file or directory

@arianvp
Copy link
Member

arianvp commented Aug 4, 2025

I don't think this is the correct fix. the whole point of systemd-vconsole-setup is to run early.

This will break things like https://github.com/systemd/systemd/blob/948b186f46d338c9cb7932816f334fd85a4ea6dd/units/systemd-ask-password-console.service#L17

Could you please provide a minimal reproducer of the issue instead?

I tried reproducing with copying from your config this:

  # Console fonts
  console = {
    font = "ter-124b";
    keyMap = "us";
    packages = with pkgs; [
      terminus_font
    ];
  };

but no luck. it just works for me 🤷

Are you doing anything in your setup related to Impermenance or having your /etc on a different partition or something weird like that?

@arianvp
Copy link
Member

arianvp commented Aug 4, 2025

I did reproduce it failing in the initrd with boot.systemd.initrd.enable = true but setting console.earlySetup = true; fixed that for me. Though it still complains because it seems there is no graphical console yet when initrd runs. (That's a different problem though)

@JaKooLit
Copy link

JaKooLit commented Aug 5, 2025

@JaKooLit you may consider disabling the masking and use this fix in your configuration.

Thanks bro. Ill disable / remove once it is merged in upstream

@JohnRTitor
Copy link
Member Author

JohnRTitor commented Aug 5, 2025

I did reproduce it failing in the initrd with boot.systemd.initrd.enable = true

I do not have systemd initrd enabled as you can see in my configuration.

❯  rga initrd
system/hardware/hardware-configuration.nix
  boot.initrd.availableKernelModules = [
  boot.initrd.kernelModules = [ "dm-snapshot" ];

system/hardware/graphics.nix
    hardware.amdgpu.initrd.enable = true; # Load AMDGPU kernel driver at initrd stage 1

The log without systemd initrd is the same:

× systemd-vconsole-setup.service - Virtual Console Setup
     Loaded: loaded (/etc/systemd/system/systemd-vconsole-setup.service; linked; preset: ignored)
     Active: failed (Result: exit-code) since Tue 2025-08-05 19:21:21 IST; 5min ago
 Invocation: 0dabf9443dc547aa90605d649ef3d62f
       Docs: man:systemd-vconsole-setup.service(8)
             man:vconsole.conf(5)
    Process: 891 ExecStart=/nix/store/wq3ivni0plh7g8xl3my8qr9llh4dy7q4-systemd-257.6/lib/systemd/systemd-vconsole-setup (code=exited, status=1/FAILURE)
   Main PID: 891 (code=exited, status=1/FAILURE)
         IP: 0B in, 0B out
         IO: 148.6M read, 0B written
   Mem peak: 8.6M
        CPU: 135ms

Aug 05 19:21:21 Ainz-NIX systemd-vconsole-setup[891]: /nix/store/mnsgwa8w8bxx8hicrsn8chj3q8vy39gz-kbd-2.7.1/bin/setfont failed with exit status 66.
Aug 05 19:21:21 Ainz-NIX systemd-vconsole-setup[995]: popen: /nix/store/g5fgsp4afxbm352jyyvk2yfygmnj7i57-gzip-1.14/bin/gzip -d -c /etc/kbd/keymaps/i386/qwerty/us.map.gz: No such file or directory
Aug 05 19:21:21 Ainz-NIX systemd-vconsole-setup[995]: popen: /nix/store/g5fgsp4afxbm352jyyvk2yfygmnj7i57-gzip-1.14/bin/gzip -d -c /nix/store/mnsgwa8w8bxx8hicrsn8chj3q8vy39gz-kbd-2.7.1/share/keymaps/i386/qwerty/us.map.gz: No such file or directory
Aug 05 19:21:21 Ainz-NIX systemd-vconsole-setup[995]: loadkeys: Unable to open file: us: No such file or directory
Aug 05 19:21:21 Ainz-NIX systemd-vconsole-setup[891]: /nix/store/mnsgwa8w8bxx8hicrsn8chj3q8vy39gz-kbd-2.7.1/bin/loadkeys failed with exit status 1.
Aug 05 19:21:21 Ainz-NIX systemd-vconsole-setup[891]: Setting source virtual console failed, ignoring remaining ones.
Aug 05 19:21:21 Ainz-NIX systemd[1]: systemd-vconsole-setup.service: Main process exited, code=exited, status=1/FAILURE
Aug 05 19:21:21 Ainz-NIX systemd[1]: systemd-vconsole-setup.service: Failed with result 'exit-code'.
Aug 05 19:21:21 Ainz-NIX systemd[1]: Failed to start Virtual Console Setup.
Aug 05 19:21:21 Ainz-NIX systemd[1]: systemd-vconsole-setup.service: Consumed 135ms CPU time, 8.6M memory peak, 148.6M read from disk.

@JohnRTitor
Copy link
Member Author

JohnRTitor commented Aug 5, 2025

Could you please provide a minimal reproducer of the issue instead?

As far as I understand, the issue is nix store not being available at the time of this service starting.

I am also using bcachefs if that's a factor. CC @ElvishJerricco who might have an idea about it.

Though AFAIK @JaKooLit does not use bcachefs and this still happens to him (unless disabled by masking).

@JohnRTitor
Copy link
Member Author

Is this with boot.initrd.systemd.enable = true?

@rnhmjoj No. but I have:

  # Console fonts
  console = {
    font = "ter-124b";
    keyMap = "us";
    packages = with pkgs; [
      terminus_font
    ];
  };

and have set console.earlySetup = true;.

@arianvp
Copy link
Member

arianvp commented Aug 5, 2025

I am also using bcachefs if that's a factor.

Do the paths actually exist on disk? bcachefs is experimental. Maybe you have data loss?

@fzakaria
Copy link
Contributor

fzakaria commented Aug 5, 2025

I wasn't using any fancy thing like bcachefs and I had the problem.

@JohnRTitor
Copy link
Member Author

Do the paths actually exist on disk?

Yes. The command if tried in a normal terminal passes.

bcachefs is experimental.

I don't think this is a Bcachefs issue persay. Because people who don't use Bcachefs also encounter it.

Bcachefs itself is almost stable, and is set to remove experimental flag in 6.18.

@arianvp
Copy link
Member

arianvp commented Aug 6, 2025

I'm just gonna keep repeating myself.

I wasn't using any fancy thing like bcachefs and I had the problem.

Again please provide a minimal nixos config that reproduces the issue. I've tried to use the console config posted here but it doesn't reproduce for me.

I can't help fix this until someone can share with me a reliable reproducer

@JohnRTitor
Copy link
Member Author

The thing is it is very hard to pinpoint what exactly is causing it. I might try removing console config then see if this issue persists, once I get home today.

Pinging @poperigby @waffle8946 @fzakaria from the Discourse thread, would love to get a reproducible example config to know what exactly causing this.

@JohnRTitor
Copy link
Member Author

JohnRTitor commented Aug 7, 2025

Did more testing.

× systemd-vconsole-setup.service - Virtual Console Setup
     Loaded: loaded (/etc/systemd/system/systemd-vconsole-setup.service; linked; preset: ignored)
     Active: failed (Result: exit-code) since Thu 2025-08-07 11:49:55 IST; 44s ago
 Invocation: ad6e05b925634d3f821c3dfc46ec366a
       Docs: man:systemd-vconsole-setup.service(8)
             man:vconsole.conf(5)
    Process: 1048 ExecStart=/nix/store/wq3ivni0plh7g8xl3my8qr9llh4dy7q4-systemd-257.6/lib/systemd/systemd-vconsole-setup (code=exited, status=1/FAILURE)
   Main PID: 1048 (code=exited, status=1/FAILURE)
         IP: 0B in, 0B out
         IO: 48.6M read, 0B written
   Mem peak: 4.8M
        CPU: 43ms

Aug 07 11:49:55 Ainz-NIX systemd[1]: Starting Virtual Console Setup...
Aug 07 11:49:55 Ainz-NIX systemd-vconsole-setup[1051]: popen: /nix/store/g5fgsp4afxbm352jyyvk2yfygmnj7i57-gzip-1.14/bin/gzip -d -c /etc/kbd/keymaps/i386/qwerty/us.map.gz: No such file or directory
Aug 07 11:49:55 Ainz-NIX systemd-vconsole-setup[1051]: popen: /nix/store/g5fgsp4afxbm352jyyvk2yfygmnj7i57-gzip-1.14/bin/gzip -d -c /nix/store/mnsgwa8w8bxx8hicrsn8chj3q8vy39gz-kbd-2.7.1/share/keymaps/i386/qwerty/us.map.gz: No such file or directory
Aug 07 11:49:55 Ainz-NIX systemd-vconsole-setup[1051]: loadkeys: Unable to open file: us: No such file or directory
Aug 07 11:49:55 Ainz-NIX systemd-vconsole-setup[1048]: /nix/store/mnsgwa8w8bxx8hicrsn8chj3q8vy39gz-kbd-2.7.1/bin/loadkeys failed with exit status 1.
Aug 07 11:49:55 Ainz-NIX systemd[1]: systemd-vconsole-setup.service: Main process exited, code=exited, status=1/FAILURE
Aug 07 11:49:55 Ainz-NIX systemd[1]: systemd-vconsole-setup.service: Failed with result 'exit-code'.
Aug 07 11:49:55 Ainz-NIX systemd[1]: Failed to start Virtual Console Setup.
Aug 07 11:49:55 Ainz-NIX systemd[1]: systemd-vconsole-setup.service: Consumed 43ms CPU time, 4.8M memory peak, 48.6M read from disk.

still happens if I entirely delete my console font config:

  console.earlySetup = true;
  # Console fonts
  console = {
    font = "ter-124b";
    keyMap = "us";
    packages = with pkgs; [
      terminus_font
    ];
  };

@rnhmjoj
Copy link
Contributor

rnhmjoj commented Aug 7, 2025

What doesn't make any sense, to me, is that it says a Nix store path doesn't exists: that can only mean that either /nix/store as a whole doesn't exist or the store is corrupted.
Excluding the latter, I think that is only possible if you're still in stage-1, with only the ramdisk fs available, because otherwise the systemd binary and all of its configuration wouldn't be available as well.

If you are really not using the systemd initrd, and the error does not come from stage-1, and the store is not corrupted, well then there must be something really cursed with your filesystem or I'm out of ideas.

@JohnRTitor
Copy link
Member Author

I tried removing my entire font config to see if it was affecting it. No luck, still happens.

Removing pieces from configurations isn't really the best way to test this. Any lead on this would be helpful.

@JohnRTitor
Copy link
Member Author

@rnhmjoj checked journalctl again. I am in stage 2. The fs is mounted.

log.txt

The attached journalctl -b for your reference.

@JohnRTitor
Copy link
Member Author

This will break things like https://github.com/systemd/systemd/blob/948b186f46d338c9cb7932816f334fd85a4ea6dd/units/systemd-ask-password-console.service#L17

@arianvp you sure? I am not sure about how this works in detail, but I assume systemd-ask-password-console asks for password to mount the rootfs? So if root fs is not even unlocked, how would /nix (not in a seperate partition) would be mounted?

How can we even access the fonts? like the way it is trying to access it here?

Aug 07 11:49:55 Ainz-NIX systemd-vconsole-setup[1051]: popen: /nix/store/g5fgsp4afxbm352jyyvk2yfygmnj7i57-gzip-1.14/bin/gzip -d -c /etc/kbd/keymaps/i386/qwerty/us.map.gz: No such file or directory
Aug 07 11:49:55 Ainz-NIX systemd-vconsole-setup[1051]: popen: /nix/store/g5fgsp4afxbm352jyyvk2yfygmnj7i57-gzip-1.14/bin/gzip -d -c /nix/store/mnsgwa8w8bxx8hicrsn8chj3q8vy39gz-kbd-2.7.1/share/keymaps/i386/qwerty/us.map.gz: No such file or directory
Aug 07 11:49:55 Ainz-NIX systemd-vconsole-setup[1051]: loadkeys: Unable to open file: us: No such file or directory

@JohnRTitor
Copy link
Member Author

From: journalctl -b | grep -i file

Aug 07 22:18:58 Ainz-NIX systemd[1]: Started Rule-based Manager for Device Events and Files.
Aug 07 22:18:58 Ainz-NIX systemd-fsck[990]: /dev/nvme1n1p1: 316 files, 122717/942794 clusters
Aug 07 22:18:58 Ainz-NIX systemd[1]: Found device WD Blue SN570 1TB EFI\x20File\x20System.
Aug 07 22:18:58 Ainz-NIX systemd[1]: Starting File System Check on /dev/disk/by-uuid/C227-45B9...
Aug 07 22:18:58 Ainz-NIX systemd[1]: Finished File System Check on /dev/disk/by-uuid/C227-45B9.
Aug 07 22:18:58 Ainz-NIX systemd-vconsole-setup[1025]: popen: /nix/store/g5fgsp4afxbm352jyyvk2yfygmnj7i57-gzip-1.14/bin/gzip -d -c
 /etc/kbd/consolefonts/ter-124b.psf.gz: No such file or directory
Aug 07 22:18:58 Ainz-NIX systemd-vconsole-setup[1025]: setfont: ERROR setfont.c:435 kfont_load_font: Unable to find file: ter-124b
Aug 07 22:18:58 Ainz-NIX systemd-vconsole-setup[1102]: popen: /nix/store/g5fgsp4afxbm352jyyvk2yfygmnj7i57-gzip-1.14/bin/gzip -d -c /etc/kbd/keymaps/i386/qwerty/us.map.gz: No such file or directory
Aug 07 22:18:58 Ainz-NIX systemd-vconsole-setup[1102]: popen: /nix/store/g5fgsp4afxbm352jyyvk2yfygmnj7i57-gzip-1.14/bin/gzip -d -c /nix/store/mnsgwa8w8bxx8hicrsn8chj3q8vy39gz-kbd-2.7.1/share/keymaps/i386/qwerty/us.map.gz: No such file or directory
Aug 07 22:18:58 Ainz-NIX systemd-vconsole-setup[1102]: loadkeys: Unable to open file: us: No such file or directory
Aug 07 22:18:59 Ainz-NIX systemd[1]: File System Check on Root Device was skipped because of an unmet condition check (ConditionPathIsReadWrite=!/).
Aug 07 22:18:59 Ainz-NIX systemd[1]: Reached target Local File Systems.
Aug 07 22:18:59 Ainz-NIX systemd[1]: Starting Create System Files and Directories...
Aug 07 22:18:59 Ainz-NIX systemd-tmpfiles[1144]: Opening file "/tmp/.X11-unix/X0" failed, proceeding without lock: No such device or address
Aug 07 22:18:59 Ainz-NIX systemd[1]: Finished Create System Files and Directories.
Aug 07 22:18:59 Ainz-NIX systemd[1]: Mounting Arbitrary Executable File Formats File System...
Aug 07 22:18:59 Ainz-NIX systemd[1]: Mounted Arbitrary Executable File Formats File System.

All I can deduce from this log is /nix is not mounted in time for vconsole-setup. If we just delay the service a bit until after local-fs.target, it works as expected.

Might be interesting:

Aug 07 22:18:59 Ainz-NIX systemd[1]: File System Check on Root Device was skipped because of an unmet condition check (ConditionPathIsReadWrite=!/).

and

Aug 07 22:18:59 Ainz-NIX systemd-tmpfiles[1144]: Opening file "/tmp/.X11-unix/X0" failed, proceeding without lock: No such device or address

@tejing1
Copy link
Contributor

tejing1 commented Aug 12, 2025

/nix should definitely be mounted before stage2 even starts. If it isn't, a lot more things than this are horribly wrong.

@rnhmjoj
Copy link
Contributor

rnhmjoj commented Aug 14, 2025

All I can deduce from this log is /nix is not mounted in time for vconsole-setup. If we just delay the service a bit until after local-fs.target, it works as expected.

As I said before, this does not make sense: the purpose of stage-1 is to mount the root (and whatever contains /nix) and start pid 1. The systemd binary itself is loaded from /nix, so how can a systemd service in stage-2 tell you that /nix is not mounted?

systemd[1]: File System Check on Root Device was skipped because of an unmet condition check (ConditionPathIsReadWrite=!/).
systemd-tmpfiles[1144]: Opening file "/tmp/.X11-unix/X0" failed, proceeding without lock: No such device or address

These again suggest that your root file system is broken; not very surprising if you're using an experimental one.
It may be corrupted, or maybe it's doing some strange asynchronous loading where only some paths are available.

Anyway, whatever your issue is, systemd-vconsole-setup is not at fault: you're having the same error in unrelated services, and services can assume the root file system to exist when they're started.

Also, systemd-vconsole-setup is a base systemd unit, used unmodified in NixOS. If you think its implementation is incorrect you should report this to systemd upstream.

Copy link
Contributor

@ElvishJerricco ElvishJerricco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As others have said, it is not possible to make it to stage 2 without the store already being fully mounted. So that's most certainly not the issue.

May 17 19:48:23 Ainz-NIX systemd-vconsole-setup[901]: popen: /nix/store/hragmx5p3izmwinv4441hj5706sxy4xs-gzip-1.13/bin/gzip -d -c /etc/kbd/keymaps/i386/qwerty/us.map.gz: No such file or directory
May 17 19:48:23 Ainz-NIX systemd-vconsole-setup[901]: popen: /nix/store/hragmx5p3izmwinv4441hj5706sxy4xs-gzip-1.13/bin/gzip -d -c /nix/store/bjzji701dz67bfrrwx9smqqyy1pnf2c9-kbd-2.6.4/share/keymaps/i386/qwerty/us.map.gz: No such file or directory
May 17 19:48:23 Ainz-NIX systemd-vconsole-setup[901]: loadkeys: Unable to open file: us: No such file or directory

In fact, this is deeply suspicious. /etc/kbd/keymaps/i386/qwerty/us.map.gz certainly should exist. And before anyone asks, yes, /etc is also mounted in stage 1 if it's a separate mountpoint, and /etc is setup by the activation script before stage 2 as well. So something really fishy here. Certainly, the currently proposed fix is not an answer.

@ElvishJerricco
Copy link
Contributor

systemd[1]: File System Check on Root Device was skipped because of an unmet condition check (ConditionPathIsReadWrite=!/).
systemd-tmpfiles[1144]: Opening file "/tmp/.X11-unix/X0" failed, proceeding without lock: No such device or address

@rnhmjoj I believe these are normal.

@nixpkgs-ci nixpkgs-ci bot removed the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Aug 14, 2025
@JohnRTitor
Copy link
Member Author

These again suggest that your root file system is broken; not very surprising if you're using an experimental one.

All I can say based on the collective reports is this isn't exclusive to Bcachefs nor every Bcachefs user experiences this.

I don't know if we can proceed here unless anyone else provides logs.

What triggers me is that NixOS is reproducible, and this behaviour is very deterministic with certain set of users/machine, perhaps the hardware (or hardware nixos configuration) is at play here.

@ElvishJerricco
Copy link
Contributor

@JohnRTitor I think you need to figure out /etc/kbd/keymaps/i386/qwerty/us.map.gz doesn't exist during boot. You could boot with systemd.unit=emergency.target (might need systemd.wants=systemd-udevd.service so that things like display and keyboard drivers can load) and use the emergency shell to look at /etc/kbd/keymaps/i386/qwerty/us.map.gz and see why it doesn't seem to exist.

@JohnRTitor
Copy link
Member Author

  systemctl status systemd-vconsole-setup.service
● systemd-vconsole-setup.service - Virtual Console Setup
     Loaded: loaded (/etc/systemd/system/systemd-vconsole-setup.service; linked; preset: ignored)
    Drop-In: /nix/store/wkn6i2x196z0ra4al787xq6wv73k4sl1-system-units/systemd-vconsole-setup.service.d
             └─overrides.conf
     Active: active (exited) since Sun 2025-08-17 02:25:04 IST; 1min 59s ago
 Invocation: 9eac309f0a3b4b8d8a7a9e58df593f83
       Docs: man:systemd-vconsole-setup.service(8)
             man:vconsole.conf(5)
    Process: 1133 ExecStart=/nix/store/wq3ivni0plh7g8xl3my8qr9llh4dy7q4-systemd-257.6/lib/systemd/systemd-vconsole-setup (code=ex>
   Main PID: 1133 (code=exited, status=0/SUCCESS)
         IP: 0B in, 0B out
         IO: 113.4M read, 0B written
   Mem peak: 9.1M
        CPU: 111ms

Aug 17 02:25:04 Ainz-NIX systemd[1]: Starting Virtual Console Setup...
Aug 17 02:25:04 Ainz-NIX systemd[1]: Finished Virtual Console Setup.

❯  cat /etc/systemd/system/systemd-vconsole-setup.service                                        
#  SPDX-License-Identifier: LGPL-2.1-or-later
#
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Virtual Console Setup
Documentation=man:systemd-vconsole-setup.service(8) man:vconsole.conf(5)

ConditionPathExists=/dev/tty0

DefaultDependencies=no
Before=sysinit.target
Before=initrd-switch-root.target shutdown.target

# This unit will be restarted by udev whenever a new vtcon device appears or is
# triggered. Usually that happens just a handful of times during boot, but some
# systems may have hundreds or thousands of serial consoles connected, so let's
# just disable the limit altogether.
StartLimitIntervalSec=0

[Service]
Type=oneshot
# This service will be restarted by udev whenever a new vtcon device appears.
# If the previous instance is still running, it shall be interrupted without
# error.
SuccessExitStatus=SIGTERM
RemainAfterExit=yes

ExecStart=/nix/store/wq3ivni0plh7g8xl3my8qr9llh4dy7q4-systemd-257.6/lib/systemd/systemd-vconsole-setup

ImportCredential=vconsole.*

Looks like it works now for some reason...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Could not start systemd-vconsole-setup.service during boot
8 participants