NixOS 21.05 on Hetzner Cloud

Hello,

I’m trying (and failing so far) to install NixOS 21.05 on the Hetzner Cloud using their provided ISO image. The installation works fine, except that GRUB2 won’t install. If I use the recommended EFI version with boot.loader.systemd-boot.enable = true, the installation completes, but the boot prompt writes GRUB and gets stuck there.

As I saw other people are running NixOS on the Hetzner Cloud, I was wondering whether some of you might know about a fix.

I’m surely missing something obvious, maybe related to HC forcing usage of GRUB? Thank you for your help.

I have seen https://github.com/nix-community/nixos-install-scripts/tree/master/hosters/hetzner-cloud but it did not help.

Did it ever boot? I use nixos-infect and it gets fucked after the first boot if I don’t label /dev/sda and mount / on that label, but I’m not sure that’s the same problem

2 Likes

If that is of any help here is the config which I use to deploy to hetzner using nixops.

I don’t remember my steps exactly, just made very bare bones system, added ssh key and then putted it under nixops config and overrided everything with actual system that I wanted.

1 Like

I don’t know if it works the same, but here’s what I use on Hetzner Robot/ bare metal.

https://nixos.wiki/wiki/Install_NixOS_on_Hetzner_Online

It uses kexec.

1 Like

Thank you all for your helpful replies!

After a bit of research I figured that the first point of issue #123376 is at work on the ISO provided by Hetzner on their Cloud instances. So my /mnt/boot directory looks like:

drwxr-xr-x 5 root root    4096 Jan  1  1970 boot

Unless there’s a way to change the date, I guess the nixos-infect method seems to be my next step.

I followed @haf’s suggestion and it worked.

  1. I chose “rebuild” in the cloud menu and selected the “Ubuntu 20.04” image
  2. I connected to the new Ubuntu and pasted the shell script from the nixos-infect page for Hetzner Cloud
  3. The system was installed and rebooted automatically.
  4. I reconnected and boom!
[root@nixos-vm:~]# cat /etc/os-release
NAME=NixOS
ID=nixos
VERSION="21.05.3294.3397f0ede9e (Okapi)"
VERSION_CODENAME=okapi
VERSION_ID="21.05.3294.3397f0ede9e"
PRETTY_NAME="NixOS 21.05 (Okapi)"
LOGO="nix-snowflake"
HOME_URL="https://nixos.org/"
DOCUMENTATION_URL="https://nixos.org/learn.html"
SUPPORT_URL="https://nixos.org/community.html"
BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues"

\o/

1 Like

I realize you have solved your use-case with nixos-infect, but just out of interest: does Hetzner allow uploading your own ISO? If so, one could upload a newer 21.05 ISO with the fix for the issue.

I don’t think they do, but I pointed their technical support to this forum, so hopefully they will find a solid resolution shortly.

1 Like

I received a nice reply from Hetzner. Here’s a substantial quote:

I have read through the thread and will forward this information development department for further checks. Please note that you are always able to use your own ISO file. You are welcome to send us a custom file with your desired content. Please send us a direct download link: This should look like the following: www.exampleserver.com/folder/folder/customfile.iso

We will gladly provide you with the desired file If you require any further help, please do not hesitate to contact us.

I guess it would be useful that the NixOS Foundation provides a link to the latest stable ISO.

Oh, and:

After feedback from the development department, we have updated the general NixOS Iso accordingly.

\o/

I will try setting up a new VM tomorrow and report here.

4 Likes