mitchellh / nixos-config

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

Running setup on vm-aarch64 throws error #12

Closed lucamaraschi closed 2 years ago

lucamaraschi commented 2 years ago

I tried to run the latest codebase on VMWare Professional Version e.x.p (18656771) and using as iso the latest generated by make iso/nixos.iso however, the make vm/bootstrap throws in the terminal with:

building the system configuration...
trace: warning: literalExample is deprecated, use literalExpression instead, or use literalDocBook for a non-Nix description.
could not find any previously installed systemd-boot
stopping the following units: -.mount, audit.service, boot.mount, dbus.service, firewall.service, kmod-static-nodes.service, mount-pstore.service, network-local-commands.service, network-setup.service, nscd.service, resolvconf.service, systemd-journal-catalog-update.service, systemd-journald.service, systemd-modules-load.service, systemd-sysctl.service, systemd-timesyncd.service, systemd-tmpfiles-setup-dev.service, systemd-udev-trigger.service, systemd-udevd.service, systemd-update-done.service
Failed to stop -.mount: Job type stop is not applicable for unit -.mount.
Warning: Stopping dbus.service, but it can still be activated by:
  dbus.socket
Warning: Stopping systemd-journald.service, but it can still be activated by:
  systemd-journald-dev-log.socket
  systemd-journald-audit.socket
  systemd-journald.socket
Warning: Stopping systemd-udevd.service, but it can still be activated by:
  systemd-udevd-control.socket
  systemd-udevd-kernel.socket
activating the configuration...
setting up /etc...
removing obsolete symlink ‘/etc/ssl/trust-source’...
restarting systemd...
Failed to list users: Unit dbus-org.freedesktop.login1.service not found.
setting up tmpfiles
reloading the following units: dbus.service, dev-hugepages.mount, dev-mqueue.mount, reload-systemd-vconsole-setup.service, sys-fs-fuse-connections.mount, sys-kernel-config.mount, sys-kernel-debug.mount
restarting the following units: dbus.socket, dhcpcd.service, network-addresses-ens160.service, nix-daemon.socket, sshd.service, systemd-coredump.socket, systemd-journald-audit.socket, systemd-journald-dev-log.socket, systemd-journald.socket, systemd-rfkill.socket, systemd-tmpfiles-clean.timer, systemd-udevd-control.socket, systemd-udevd-kernel.socket
warning: some sockets failed to restart. Please check your journal (journalctl -eb) and act accordingly.
starting the following units: -.mount, audit.service, boot.mount, kmod-static-nodes.service, mount-pstore.service, network-local-commands.service, network-setup.service, nscd.service, resolvconf.service, systemd-journal-catalog-update.service, systemd-modules-load.service, systemd-sysctl.service, systemd-timesyncd.service, systemd-tmpfiles-setup-dev.service, systemd-udev-trigger.service, systemd-update-done.service
org.freedesktop.DBus.Error.Disconnected: Connection was disconnected before a reply was received
warning: error(s) occurred while switching to the new configuration
make[1]: *** [vm/switch] Error 1
make: *** [vm/bootstrap] Error 2

and in the VM with unknown ioctl 1976.

In order to set up NixOS, I changed the HDD to SATA in the VM configuration (instead of SCSI).

VanceLongwill commented 2 years ago

Also ran into a similar issue:

Error: Could not stat device /dev/sda - No such file or directory.
Error: Could not stat device /dev/sda - No such file or directory.
Error: Could not stat device /dev/sda - No such file or directory.
Error: Could not stat device /dev/sda - No such file or directory.
Error: Could not stat device /dev/sda - No such file or directory.
mke2fs 1.46.4 (18-Aug-2021)
The file /dev/sda1 does not exist and no size was specified.
mkswap: cannot open /dev/sda2: No such file or directory
mkfs.fat 4.1 (2017-01-24)
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
mkfs.fat: unable to open /dev/sda3: No such file or directory
mount: /mnt: special device /dev/disk/by-label/nixos does not exist.
mount: /mnt/boot: special device /dev/disk/by-label/boot does not exist.
writing /mnt/etc/nixos/hardware-configuration.nix...
writing /mnt/etc/nixos/configuration.nix...
For more hardware-specific settings, see https://github.com/NixOS/nixos-hardware.
building the configuration in /mnt/etc/nixos/configuration.nix...
error:
       Failed assertions:
       - The ‘fileSystems’ option does not specify your root file system.
(use '--show-trace' to show detailed location information)
Connection to 172.16.95.128 closed by remote host.
make: *** [vm/bootstrap0] Error 255

Changing the HDD to SATA as you suggested resolved the issue

lucamaraschi commented 2 years ago

@VanceLongwill could get through vm/bootstrap successfully?I got the latest version of the repository and I am still facing the same issue as described above.

I also changed NIXNAME ?= vm-aarch64 in Makefile to set the platform to M1.

VanceLongwill commented 2 years ago

It took a bit of trial & error (I'm new to nix) but I got it working.

I had to:

https://github.com/VanceLongwill/nixos-config/tree/vance

lucamaraschi commented 2 years ago

Good catch @VanceLongwill! For everyone's reference, the SSH key and the password should be changed in users/{USERNAME}/nixos.nix

mitchellh commented 2 years ago

I can't reproduce this error, I just rebuilt my whole VM from scratch on a diff machine and it all worked.

lucamaraschi commented 2 years ago

Thanks @mitchellh ...I am gonna also test on a fresh macbook pro M1 Max machine