Skip to content
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

Default VM configuration login fails #351

Open
me-and opened this issue Jul 13, 2024 · 3 comments
Open

Default VM configuration login fails #351

me-and opened this issue Jul 13, 2024 · 3 comments

Comments

@me-and
Copy link

me-and commented Jul 13, 2024

Running nixos-generate -f vm-nogui --run produces a VM that boots, but it fails at the login stage with the following error:

<<< Welcome to NixOS 24.05.2662.249fbde2a178 (x86_64) - ttyS0 >>>

Run 'nixos-help' for the NixOS manual.

nixos login: root (automatic login)


User not known to the underlying authentication module

It looks like running with -f vm fails similarly, but the error flashes up on screen too briefly to read clearly.

The only similar error I was able to find was NixOS/nixpkgs#218813, but the fix that apparently worked there – configuring services.nscd.enableNsncd = false – did not seem to make any difference here. (More accurately, what I did was copy the default config /nix/store/q342qhd6yvvnb6rgqg2syd71zvzdl1x0-nixos-generators-1.8.0/share/nixos-generator/configuration.nix per nixos-generate --help to a local file, added that configuration line, then built that configuration path with -c.)

My environment, per nix-shell -p nix-info --run 'nix-info -m':

  • system: "x86_64-linux"
  • host os: Linux 5.15.153.1-microsoft-standard-WSL2, NixOS, 24.05 (Uakari), 24.05.2662.249fbde2a178
  • multi-user?: yes
  • sandbox: relaxed
  • version: nix-env (Nix) 2.18.4
  • channels(root): "home-manager-24.05.tar.gz, nixos-24.05, nixos-unstable, nixos-wsl"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
@maround95
Copy link

I'm also facing the same issue with all the vm-* variants.
During boot, I noticed that the following error message is shown very briefly:
activation script snippet 'users' failed (-2)

@stackcoder
Copy link

While ISO images just work, the vm variants seems to require a non empty user configuration. Adding this to my configuration fixed it for me:

users.users.root.password = "";

@me-and
Copy link
Author

me-and commented Oct 29, 2024

This seems to have started working spontaneously to me. I've attempted to reproduce it with a nixpkgs checkout at the same commit I was using previously, but even that doesn't reproduce. Which I'm baffled by, as I'd thought that would run something identical to the test that was failing previously!

Specifically, I'd expected running the below command in a nixpkgs repository to unambiguously repeat the same test I saw failing previously, but I'm now getting a VM that seems to work just fine.

git clean -dffx && 
git switch --detach 249fbde2a178 && 
nix-build -A nixos-generators && 
./result/bin/nixos-generate -f vm-nogui --run -I nixpkgs=$PWD

I'm not going to close this issue just yet: the fact that I can't reproduce the failure any more makes me worry the problem hasn't actually been fixed…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants