NixOS on Hetzner Cloud ARM

Hi,
I am having trouble getting NixOS to run on the new ARM instances provided by Hetzner’s Cloud services. I am getting through to the bootloader now, but after that there is no output on screen and no ssh starting up.

I was wondering whether anyone has a working configuration for NixOS on Hetzner ARM… Otherwise hints are also much appreciated :slight_smile:

2 Likes

Hey, I got an ARM instance up and running last week using nixos-anywhere.

I since moved to x86 because some of the services I wanted to run exhibited poor performance on ARM but I’ve revived the initial config I used to build the ARM server and put it up on a branch Comparing main...hetzner-arm-old-config · alexghr/nix · GitHub (host b1droid). It’s a bit messy but it follows the examples from nixos-anywhere.

The install command I used is at the top of the configuration.nix file. Run this from your host and replace the ip of the target server.

nix run github:numtide/nixos-anywhere -- --flake .#b1droid root@<ip> --kexec "$(nix build --print-out-paths github:nix-community/nixos-images#packages.aarch64-linux.kexec-installer-nixos-2211-noninteractive)/nixos-kexec-installer-noninteractive-aarch64-linux.tar.gz"

I used the 22.11 image because 23.05 wasn’t available in nixos-images at the time.

Hope this helps :slight_smile:

I tried the boot config you used and still get a black screen and an unpingable server after going through the bootloader. I will probably just move back to x86 units as well…

I tried it with unstable and it appears to work. It did not work with an older unstable (arround 2 months old) and I had to use master to get it working.

I configured IPv4 statically, but dhcp seems to work aswell. IPv6 doesn’t work so well over dhcp, so it needs to be configured statically, gateway is fe80::1

1 Like

The network bits are also well covered on the wiki: Install NixOS on Hetzner Cloud - NixOS Wiki.

Make sure your hardware-configuration.nix includes the qemu-quest.nix profile.

And for a proper boot log, consider this snippet:

  # workaround because the console defaults to serial
  boot.kernelParams = [ "console=tty" ];
  # initialize the display early to get a complete log
  boot.initrd.kernelModules = [ "virtio_gpu" ];
1 Like

I assume services.qemuGuest.enable = true; should to the job?

As for the other parameters this might actually be the missing bit - I’ll try it out…

Thanks for the hints…

I am also using unstable so this should be fine, but I just noticed that I for some reason had commented out the proper network config (I don’t think on purpose), so lets see whether this changes anything…

No, I was talking about this import, that should be in hardware-configuration, which is generated by the nixos-generate-config script.

  imports = [
    (modulesPath + "/profiles/qemu-guest.nix")
  ];

I also hit boot issues with the ARM instances.
Setting boot.loader.systemd-boot.enable = true; seems to fix the problem.

Sooo… turns out I had just misconfigured my drives, which I did not notice, because it was not outputing anything on screen. It is working fine now with systemd-boot and dhcp.

I also used the opportunity to take a look at nixos-anywhere which is really quite nice, but I did struggle with the binary cache so it took me 2h to build a kexec image xD

Thanks for the helpful input and support :slight_smile:

2 Likes