mitchellh / nixos-config

My NixOS configurations.

Home Page:https://twitter.com/mitchellh/status/1346136404682625024

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stuck at restart dhcpd.service and sshd.service?

tmpm697 opened this issue · comments

I'm tryng to default test this repo, but when i do make vm/bootstrap i got this errro:

building '/nix/store/gw61nhppdd7qwzjbng88mhccaphy7n2a-system-units.drv'...
building '/nix/store/4swkhlmpyxcbrkk373168h4gazc3sgld-etc.drv'...
building '/nix/store/4n4wh9xbhqnjgdi08z22dyrbw8yhmyyw-nixos-system-dev-23.05.20230728.48e82fe.drv'...
stopping the following units: -.mount, boot.mount, firewall.service, network-setup.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-7130\x2dF67C.service
activating the configuration...
setting up /etc...
reloading user units for root...
setting up tmpfiles
reloading the following units: dbus.service
restarting the following units: dhcpcd.service, sshd.service
client_loop: send disconnect: Broken pipe
make[1]: *** [Makefile:115: vm/switch] Error 255
make[1]: Leaving directory '/home/user/.nix/nixos-config'
make: *** [Makefile:83: vm/bootstrap] Error 2

the config is kept unchange while i'm doing the test. but this test is with kvm/qemu as vm on archliux, not a vm on macos.

i use host networking for vm, so vm get ip address directly from router.

then I have this change:
vi machines/vm-intel.nix

{ config, pkgs, ... }: {
  imports = [
    ./vm-shared.nix
  ];

  # virtualisation.vmware.guest.enable = true;

  # Interface is this on Intel Fusion
  # networking.interfaces.ens33.useDHCP = true;

  # Shared folder to host works on Intel
  # fileSystems."/host" = {
  #   fsType = "fuse./run/current-system/sw/bin/vmhgfs-fuse";
  #   device = ".host:/";
  #   options = [
  #     "umask=22"
  #     "uid=1000"
  #     "gid=1000"
  #     "allow_other"
  #     "auto_unmount"
  #     "defaults"
  #   ];
  # };
}

it stuck at:

building '/nix/store/szfnbji0y6dd3sgzjfvr5kqlyx6286if-etc.drv'...
building '/nix/store/9bb8qhrng6ba7w4776p4kqbyikrgwips-nixos-system-dev-23.05.20230728.48e82fe.drv'...
stopping the following units: -.mount, boot.mount, dhcpcd.service, firewall.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.

ip ad under vm show no ip address that host can ping (the ip address from previou step that i export NIXADDR= gone)

thanks for the config but i stopped this test, might refer to it later when i have time.

I went through the same issue, after a day testing all configs possible I found a way to workaround this, and what worked was the following:

  • Keep this setting in vm-intel.nix
    networking.interfaces.ens33.useDHCP = true;

  • Go to vm-shared.nix and change the DHCP setting to networking.interfaces.ens33.useDHCP = true;

Now all the services restarted and the VM boots with internet.
I also changed SATA to SCSI on Windows, and it worked.