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

Target with no access to internet #296

Open
Rider128 opened this issue Mar 28, 2024 · 4 comments
Open

Target with no access to internet #296

Rider128 opened this issue Mar 28, 2024 · 4 comments

Comments

@Rider128
Copy link

Hello,

I am writing to request a feature that would allow for offline installation of nixOS anywhere. Currently, the installation script attempts to download the kexec installer from the internet, which is problematic for systems without internet access.

Here is the error message I encountered during my attempt to install NixOS on an offline system:

### Gathering machine facts ###
Pseudo-terminal will not be allocated because stdin is not a terminal.
Warning: Permanently added '192.168.100.129' (ED25519) to the list of known hosts.
sh: 11: [[: not found
sh: 12: [[: not found
### Switching system into kexec ###
Pseudo-terminal will not be allocated because stdin is not a terminal.
Warning: Permanently added '192.168.100.129' (ED25519) to the list of known hosts.
Warning: Permanently added '192.168.100.129' (ED25519) to the list of known hosts.
--2024-03-28 09:24:41--  https://github.com/nix-community/nixos-images/releases/download/nixos-23.11/nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz
Résolution de github.com (github.com)… échec : Échec temporaire dans la résolution du nom.
wget : impossible de résoudre l’adresse de l’hôte ‘github.com’

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Connection to 192.168.100.129 closed.

I propose that an option be added to the installation script to allow for the local download of the kexec file, which can then be transferred to the target system using scp or another file transfer method. This would greatly facilitate the installation of NixOS on systems without internet access.

Thank you for considering this request.

@phaer
Copy link
Member

phaer commented Mar 28, 2024

Hello,

I propose that an option be added to the installation script to allow for the local download of the kexec file, which can then be transferred to the target system using scp or another file transfer method.

You can already scp a custom (or pre-downloaded) kexec image and pass the filename to nixos-anywheres --kexec argument. I think that's what you are asking for here?

@Rider128
Copy link
Author

It's not quite what I was asking here. I was asking about a feature that allows the local machine to automatically 'wget' the correct 'kexec' file and then 'scp' the 'kexec' file to the target host. The goal is to automate the system for offline targets and always ensure we send the latest and correct 'kexec' file.

@phaer
Copy link
Member

phaer commented Mar 28, 2024

Okay, just to make sure: You are asking about a flag that does the equivalent of:

curl -O https://github.com/nix-community/nixos-images/releases/download/nixos-23.11/nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz
scp nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz $target_host:
nixos-anywhere --kexec nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz [...] $target_host

The installation should then work without network - except for the SSH connection you need for nixos-anywhere - anywhere.

@Rider128
Copy link
Author

That's what I was thinking 👍

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

2 participants