NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.41k stars 13.62k forks source link

Running netboot with console redirect ttyS0 reports strange errors at nixos login #78345

Open CMCDragonkai opened 4 years ago

CMCDragonkai commented 4 years ago

Describe the bug

When running the netboot.x86_64-linux image in QEMU with console redirected to ttyS0, I see these 3 errors in a non-deterministic way:

<<< Welcome to NixOS 19.09beta-61689.gfedcba (x86_64) - ttyS0 >>>
The "nixos" and "root" accounts have empty passwords.

Type `sudo systemctl start sshd` to start the SSH daemon.
You then must set a password for either "root" or "nixos"
with `passwd` to be able to login.

Run `nixos-help` or press <Alt-F8> for the NixOS manual.

nixos login: nixos (automatic login)

ln: failed to create symbolic link '/home/nixos/.nix-profile': File exists
rm: cannot remove '/home/nixos/.nix-defexpr': Is a directory
ln: failed to create symbolic link '/home/nixos/.nix-defexpr/channels_root/channels': Read-only file system

But sometimes it will be:

<<< Welcome to NixOS 19.09beta-61689.gfedcba (x86_64) - ttyS0 >>>
The "nixos" and "root" accounts have empty passwords.

Type `sudo systemctl start sshd` to start the SSH daemon.
You then must set a password for either "root" or "nixos"
with `passwd` to be able to login.

Run `nixos-help` or press <Alt-F8> for the NixOS manual.

nixos login: nixos (automatic login)

ln: failed to create symbolic link '/home/nixos/.nix-profile': File exists
ln: failed to create symbolic link '/home/nixos/.nix-defexpr/channels_root/channels': Read-only file sysm

Sometimes I don't see anything. Weird errors that only occur sometimes. Not sure what's calling ln here.

This never happens (I haven't seen it) when I don't use console redirect, and with -vga std.

To Reproduce

Build the image:

:b (import (pkgs.path + "/nixos/release.nix") {}).netboot.x86_64-linux

Then run it in QEMU:

qemu-system-x86_64 \
  -smp $(nproc) \
  -m 8G \
  -nographic \
  -accel kvm \
  -device virtio-net,netdev=vmnic \
  -netdev user,id=vmnic \
  -kernel ./tmp/bzImage \
  -initrd ./tmp/initrd \
  -append "$(grep kernel ./tmp/netboot.ipxe | cut -f 3- -d ' ') console=ttyS0,115200"
stale[bot] commented 4 years ago

Hello, I'm a bot and I thank you in the name of the community for opening this issue.

To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it.

If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them.

Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel.

pickfire commented 3 years ago

I seemed to get the same issue too but without netboot.

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info