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

Fails install on Virtual Machine #469

Open
Anarcho opened this issue Feb 13, 2025 · 2 comments
Open

Fails install on Virtual Machine #469

Anarcho opened this issue Feb 13, 2025 · 2 comments

Comments

@Anarcho
Copy link

Anarcho commented Feb 13, 2025

Error occurs when running command:

nix run github:nix-community/nixos-anywhere -- --generate-hardware-config nixos-generate-config ./configurations/nixos/vm/hardware-configuration.nix --flake '.#vm' --target-host root@<ip address>

Error:

Now try logging into the machine, with: "ssh -i /tmp/tmp.Zv5bVIJelM/nixos-anywhere -o 'ConnectTimeout=10' -o 'UserKnownHostsFile=/dev/null' -o 'StrictHostKeyChecking=no' 'nixos@<IP Address>'"
and check to make sure that only the key(s) you wanted were added.

### Gathering machine facts ###
Pseudo-terminal will not be allocated because stdin is not a terminal.
Warning: Permanently added '<IP ADDRESS>' (ED25519) to the list of known hosts.
### Generating hardware-configuration.nix using nixos-generate-config ###
Warning: Permanently added '<IP ADDRESS>' (ED25519) to the list of known hosts.
~/repos/nix-config/configurations/nixos/vm ~/repos/nix-config
~/repos/nix-config
Warning: Permanently added '<IP ADDRESS>' (ED25519) to the list of known hosts.
error: 'config' is not a recognised command
Try 'nix --help' for more information.

Debug logs (tail)

Warning: Permanently added '<IP ADDRESS>' (ED25519) to the list of known hosts.
+ command -v git
++ dirname /home/aaronk/repos/nix-config/configurations/nixos/vm/hardware-configuration.nix
+ pushd /home/aaronk/repos/nix-config/configurations/nixos/vm
~/repos/nix-config/configurations/nixos/vm ~/repos/nix-config
+ git rev-parse --is-inside-work-tree
+ git add --intent-to-add --force -- /home/aaronk/repos/nix-config/configurations/nixos/vm/hardware-configuration.nix
+ popd
~/repos/nix-config
+ [[ auto == \a\u\t\o ]]
+ local remoteSystem
++ runSshNoTty -o ConnectTimeout=10 nix --extra-experimental-features nix-command config show system
++ ssh -i /tmp/tmp.JSOhflq69L/nixos-anywhere -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no nixos@<IP ADDRESS> -o ConnectTimeout=10 nix --extra-experimental-features nix-command config show system
Warning: Permanently added '<IP ADDRESS>' (ED25519) to the list of known hosts.
error: 'config' is not a recognised command
Try 'nix --help' for more information.
+ remoteSystem=
+ rm -rf /tmp/tmp.JSOhflq69L

Tried with root@<ip address>

When running below command - it works.

nix run github:nix-community/nixos-anywhere/acc1651576dac4e736e05021836fd50d45f8046b -- --generate-hardware-config nixos-generate-config ./configurations/nixos/vm/hardware-configuration.nix --flake '.#vm' --target-host nixos@<IP ADDRESS>

@errnoh
Copy link

errnoh commented Feb 19, 2025

I've ran into this same problem the whole day until finally finding this issue. In my case it's not a VM that I'm trying to target but an actual physical machine (booted into 24.05 installation media).

Using acc1651576dac4e736e05021836fd50d45f8046b does in fact seem to solve the issue.

@phaer
Copy link
Member

phaer commented Feb 24, 2025

@Anarcho Did you boot an older installer on the target host as well?

Context: The root-cause for your issue is that your nix version is too old. nix config which is used here, was introduced in nix 2.20, a bit over a year ago.

@errnoh Error message should be better, but 24.05 isn't supported upstream anymore. Please use at least a 24.11 installer.

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

3 participants