Closed dereulenspiegel closed 2 months ago
It seems that the disko script is copied to the target machine
you verified that its there in the store on the remote?
I would suggest on the target machine try using disko-install directly and see if that works - then work backwards.
Hi @sedlund and thanks for the advice. Thanks to your hint I think the problem is the nix copy
command stalling after calling nix-store --serve --write
on the target.
Running the nix copy command manually and with debug gives me
performing daemon worker op: 40
querying info about missing paths...
starting pool of 9 threads
performing daemon worker op: 46
substitution of '/nix/store/y4pn8qg3vjf4gmvg3s1i6z79kpb2cwmw-disko': created
substitution of '/nix/store/y4pn8qg3vjf4gmvg3s1i6z79kpb2cwmw-disko': woken up
querying info about missing paths...
starting pool of 9 threads
entered goal loop
substitution of '/nix/store/y4pn8qg3vjf4gmvg3s1i6z79kpb2cwmw-disko': init
acquiring write lock on '/nix/var/nix/temproots/56502'
substitution of '/nix/store/y4pn8qg3vjf4gmvg3s1i6z79kpb2cwmw-disko': done
substitution of '/nix/store/y4pn8qg3vjf4gmvg3s1i6z79kpb2cwmw-disko': goal destroyed
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
performing daemon worker op: 26
OpenSSH_9.7p1, OpenSSL 3.0.14 4 Jun 2024
debug1: Reading configuration data /Users/till/.ssh/config
debug1: /Users/till/.ssh/config line 1: include ~/.ssh/config.d/* matched no files
debug1: /Users/till/.ssh/config line 15: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Reading configuration data /etc/ssh/ssh_config.d/100-linux-builder.conf
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug1: Connecting to 192.168.205.5 [192.168.205.5] port 22.
debug1: Connection established.
debug1: identity file /Users/till/.ssh/id_rsa type -1
debug1: identity file /Users/till/.ssh/id_rsa-cert type -1
debug1: identity file /Users/till/.ssh/id_ecdsa type -1
debug1: identity file /Users/till/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/till/.ssh/id_ecdsa_sk type -1
debug1: identity file /Users/till/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /Users/till/.ssh/id_ed25519 type -1
debug1: identity file /Users/till/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/till/.ssh/id_ed25519_sk type -1
debug1: identity file /Users/till/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /Users/till/.ssh/id_xmss type -1
debug1: identity file /Users/till/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_9.7
debug1: Remote protocol version 2.0, remote software version OpenSSH_9.7
debug1: compat_banner: match: OpenSSH_9.7 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 192.168.205.5:22 as 'root'
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: sntrup761x25519-sha512@openssh.com
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:z5UzX+CiDaXVWEUmP3cKkWfMlCCMVY0Pq5R03kSmzyw
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: Host '192.168.205.5' is known and matches the ED25519 host key.
debug1: Found key in /Users/till/.ssh/known_hosts:23
debug1: ssh_packet_send2_wrapped: resetting send seqnr 3
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: Sending SSH2_MSG_EXT_INFO
debug1: expecting SSH2_MSG_NEWKEYS
debug1: ssh_packet_read_poll2: resetting read seqnr 3
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_ext_info_client_parse: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256>
debug1: kex_ext_info_check_ver: publickey-hostbound@openssh.com=<0>
debug1: kex_ext_info_check_ver: ping@openssh.com=<0>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_ext_info_client_parse: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256>
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: get_agent_identities: agent returned 1 keys
debug1: Will attempt key: cardno:8_710_580 RSA SHA256:C5Sfgoq8w2laHK7tPE5CdXezdAlhOtMemNuVuPdW1Ig agent
debug1: Will attempt key: /Users/till/.ssh/id_rsa
debug1: Will attempt key: /Users/till/.ssh/id_ecdsa
debug1: Will attempt key: /Users/till/.ssh/id_ecdsa_sk
debug1: Will attempt key: /Users/till/.ssh/id_ed25519
debug1: Will attempt key: /Users/till/.ssh/id_ed25519_sk
debug1: Will attempt key: /Users/till/.ssh/id_xmss
debug1: Offering public key: cardno:8_710_580 RSA SHA256:C5Sfgoq8w2laHK7tPE5CdXezdAlhOtMemNuVuPdW1Ig agent
debug1: Server accepts key: cardno:8_710_580 RSA SHA256:C5Sfgoq8w2laHK7tPE5CdXezdAlhOtMemNuVuPdW1Ig agent
Authenticated to 192.168.205.5 ([192.168.205.5]:22) using "publickey".
debug1: setting up multiplex master socket
ControlSocket /Users/till/.ssh/master-root@192.168.205.5:22 already exists, disabling multiplexing
debug1: channel 0: new session [client-session] (inactive timeout: 0)
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: exec
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: client_input_hostkeys: searching /Users/till/.ssh/known_hosts for 192.168.205.5 / (none)
debug1: client_input_hostkeys: no new or deprecated keys from server
debug1: Remote: /etc/ssh/authorized_keys.d/root:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Remote: /etc/ssh/authorized_keys.d/root:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Sending environment.
debug1: channel 0: setting env LC_TERMINAL_VERSION = "3.4.16"
debug1: channel 0: setting env LANG = "de_DE.UTF-8"
debug1: channel 0: setting env LC_TERMINAL = "iTerm2"
debug1: Sending command: nix-store --serve --write
debug1: pledge: fork
Which still doesn't contain any obvious error. I can also confirm that nix-store --serve --write
is actually running on the target machine.
Currently I am guessing that since nix-store --serve
works by serving through stdin/stdout that maybe my ssh config could interfering with this process, causing a stall. But maybe I am wrong, so I am still glad for every pointer in more directions helping me debug/fix this :)
It looks like you have a yubikey or using macos touchid.
the last output with your manual run of nix copy
shows nix-copy is authenticating with it.
I would suggest setting a root password on the target and not have any keys on the remote and typing it in when running nixos-anywhere. It will then use its self generated key for connecting.
Ok, after experimenting with my SSH config I found the cause for the problem (but not an explanation).
By default I set ControlMaster yes
for all my hosts. This seems to cause problems. Temporarely setting ControlMaster no
for the target host seem to solve the problem.
Thanks for the advice and I hope this issue helps anyone else struggling with this :)
Hello,
I am currently trying to migrate my homelab to nixos and for baremetal deployment I would like to use nixos-anywhere. As a first test I tried setting up a VM running under UTM in macOS (x86_64). Unfortunately nixos-anywhere just kinda seems to stop at some point and doesn't do anything. No partitioning is done on the target machine, no error (I picked up on) is emitted. Here is the debug log of my latest attempt after I let everything run for about 8 hours:
nix run github:nix-community/nixos-anywhere -- --flake .#limiting-factor -L --debug root@192.168.205.5
It seems that the disko script is copied to the target machine, but then never executed or silently fails and stops everything.
dmesg
andjournalctl
on the target machine also don't seem to have any error messages.I am quite new to nix and nixos so I am probably missing something quite obvious, but after going through all the documentation and examples I found, I can't figure out what.
Thanks in advance :)