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

nixos-rebuild build-vm - fails with "waiting for device to appear" #246

Open
vacy opened this issue Dec 22, 2024 · 0 comments
Open

nixos-rebuild build-vm - fails with "waiting for device to appear" #246

vacy opened this issue Dec 22, 2024 · 0 comments

Comments

@vacy
Copy link

vacy commented Dec 22, 2024

Hello,

thank you for the effort on the module, much appreciated!
I am fairly new to nixOS, just started a month ago and from the very beginning I wanted to setup my systems with impermanence - and now I am about to get it done - sooo close!

Now I

  1. took my testsystems hardwareconfig and modified the mounts
  2. added the impermanence module + config to the flake
  3. ran nixos-rebuild --flake .#testvm build-vm

It builds the vm perfectly fine, but the boot fails in stage1 since its

"waiting for device /mnt-root/nix/persist/system/var/lib/nixos to appear"

and fails into:

"nixos failed: No such file or directory"

I dont know where the "mnt-root" comes from, I dont find it in my own config nor in your codebase here on github, so I am guessing thats coming from nixOS itself?
You'll see some mntroot mounts in my config, that is me stumbling around with that error message, I tried to align my config with the error message and had configured to mount to /mnt-root in the beginning.
But changed back to /mntroot later on.

[root@nixtop:/etc/nixos/flakes]# grep -r mnt-root
grep: vm.qcow2: binary file matches

So I figured the /nix/persist/system does not exist on a new system, I did some research and guess your #193 sounds promising.
But I am running on your master branch, so I wont know how to continue.

Ive tried to workaround that problem in the flake with:

systemd.tmpfiles.rules = [
"d /nix/persist/ 0755 root root"
"d /nix/persist/system 0755 root root"
];

Doesnt matter, it ends up in the same problem.
So my best guess is: build-vm is out of scope for your project?
Oh headsup, I am still on 24.05
edit:/ changed my flake inputs to 24.11 and came up with the same problem. sitenote: nix is great for being that quick making such changes :)

Config details:

flake

environment.persistence."/nix/persist/system" = {
hideMounts = true;
directories = [
"/var/log"
"/var/lib/bluetooth"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
"/etc/NetworkManager/system-connections"
{ directory = "/var/lib/colord"; user = "colord"; group = "colord"; mode = "u=rwx,g=rx,o="; }
];
files = [
"/etc/machine-id"
{ file = "/etc/nix/id_rsa"; parentDirectory = { mode = "u=rwx,g=,o="; }; }
];
};

hardware config

fileSystems."/mntroot" =
{ device = "/dev/disk/by-uuid/e68f113f-fd75-42d7-83f6-11162ee458ef";
fsType = "ext4";
neededForBoot = true;
};

fileSystems."/boot/efi" =
{ device = "/dev/disk/by-uuid/2F54-21C5";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
depends = [ "/boot" ];
};

fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/ceded120-72ae-4d1d-a847-577eb072732c";
fsType = "ext4";
neededForBoot = true;
};

fileSystems."/boot" =
{ device = "/mntroot/boot";
fsType = "bind";
depends = [ "/mntroot" ];
};

fileSystems."/home" =
{ device = "/mntroot/home";
fsType = "bind";
depends = [ "/mntroot" ];
};

fileSystems."/" =
{ device = "none";
fsType = "tmpfs";
neededForBoot = true;
options = [ "size=200M" "mode=755" ]; # mode=755 so only root can write to those files
};

@vacy vacy changed the title Q: impermanence with nixos-rebuild build-vm - is that supposed to fail and out of scope? nixos-rebuild build-vm - fails with "waiting for device to appear" Dec 23, 2024
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

1 participant