mitchellh / nixos-config

My NixOS configurations.
https://twitter.com/mitchellh/status/1346136404682625024
MIT License
1.93k stars 191 forks source link

emergency mode #9

Closed nikgalushko closed 2 years ago

nikgalushko commented 2 years ago

Hi. I tried to reproduce your environment over all steps (I also saw your video). The step vm/bootstrap0 is ok, but I got an error (check the screenshot) on next step vm/bootstrap. The last log is

building the system configuration...
stopping the following units: -.mount, boot.mount, firewall.service, network-addresses-enp0s5.service, network-setup.service, nscd.service, systemd-modules-load.service, systemd-sysctl.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-udevd.service
Failed to stop -.mount: Job type stop is not applicable for unit -.mount.
NOT restarting the following changed units: systemd-fsck@dev-disk-by\x2duuid-D605\x2d8851.service
activating the configuration...
setting up /etc...
removing obsolete symlink ‘/etc/systemd/network/40-enp0s5.link’...
reloading user units for root...
setting up tmpfiles
reloading the following units: dbus.service, reload-systemd-vconsole-setup.service
restarting the following units: dhcpcd.service, sshd.service
Снимок экрана 2021-11-07 в 10 33 58
indiv0 commented 2 years ago

I get dropped into emergency mode when I have the filesystem sharing enabled (not sure why yet) so maybe try turning that off for now.

Also, double check that the interface being configured (in machines/*.nix) is the same as the one in the VM (check with ifconfig).

mitchellh commented 2 years ago

Other folks have ran into this by not carefully setting up the VM settings as I show in my youtube video. I personally can't see this happening on my local systems (recently I rebootsrapped), so I'm going to close. If anyone figures it out please let me know and I'd be happy to incorporate any changes.

obi12341 commented 2 years ago

i encoutered this problem when only giving the machine 4Gig of memory as some tests failed on installing, so probably make sure to give the vm enough memory.

joshrosso commented 2 years ago

@obi12341 do you recall what amount of memory worked for you?

I'm currently allocating 12GB and also end up in emergency mode.

building '/nix/store/lq2a66ldpyj2qd412cwyaf3l73h0b2jl-etc.drv'...
building '/nix/store/wd35px6rr2c0g6rqy0rr0pwaicq08997-nixos-system-dev-22.05.20220811.aafac0d.drv'...
leaving systemd-boot 251.3 in place (250.4 is not newer)
stopping the following units: -.mount, audit.service, boot.mount, firewall.service, kmod-static-nodes.service, logrotate-checkconf.service, mount-pstore.service, network-local-commands.service, network-setup.service, nscd.service, resolvconf.service, systemd-modules-load.service, systemd-sysctl.service, systemd-timesyncd.service, systemd-udev-trigger.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-udevd.service, systemd-update-done.service
Failed to stop -.mount: Job type stop is not applicable for unit -.mount.
NOT restarting the following changed units: getty@tty1.service, systemd-fsck@dev-disk-by\x2duuid-08AE\x2d6174.service, systemd-journal-flush.service, systemd-logind.service, systemd-random-seed.service, systemd-remount-fs.service, systemd-update-utmp.service, systemd-user-sessions.service, user-runtime-dir@0.service, user@0.service
activating the configuration...
removing group ‘nscd’
removing user ‘nscd’
setting up /etc...
restarting systemd...
reloading user units for root...
setting up tmpfiles
reloading the following units: dbus.service, reload-systemd-vconsole-setup.service
restarting the following units: dhcpcd.service, sshd.service, systemd-journald.service
starting the following units: -.mount, audit.service, boot.mount, kmod-static-nodes.service, logrotate-checkconf.service, mount-pstore.service, network-local-commands.service, network-setup.service, nscd.service, resolvconf.service, systemd-modules-load.service, systemd-sysctl.service, systemd-timesyncd.service, systemd-udev-trigger.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-update-done.service

Thanks!

joshrosso commented 2 years ago

It was resolved for me by removing the configuration for sharing the FS.

Which is OK for me since I don't need them shared.

https://github.com/mitchellh/nixos-config/blob/79cd7704f8bd45800ed846fdceb8c1c26bcebd1a/machines/vm-aarch64.nix#L21-L33