Le Blog Utux

Parce qu'il n'y a pas que Linkedin pour se faire mousser avec des articles techniques

Install openSUSE from Alpine on aarch64 on Hetzner

Rédigé par uTux

Hetzner provides a console access (aka kvm ip) on cheap virtual servers which is really a cool thing. While it's not possible to mount a custom iso image, they have a library with multiple choices. The openSUSE project has iso images for aarch64 but unfortunately they are missing on hetzner.

Fortunately it is possible to boot another iso and install openSUSE anyway.

  1. Provision an aarch64 virtual machine with any system.
  2. Mount the Alpine iso, reboot the virtual machine and open console / kvm ip.
  3. Login as "root" (no password) and run "setup-alpine". Set your keyboard, configure Network, and press CTRL+C to cancel.

Find the latest "Generic" KVM/Xen aarch64 image on openSUSE's website and grab it:

curl -O https://fr2.rpmfind.net/linux/opensuse/distribution/leap/15.5/appliances/openSUSE-Leap-15.5-Minimal-VM.aarch64-kvm.qcow2

Edit /etc/apk/repositories then add:

http://dl-cdn.alpinelinux.org/alpine/v3.19/main
http://dl-cdn.alpinelinux.org/alpine/v3.19/community

Install qemu-img and convert the qcow2 image to raw:

apk update && apk add qemu-img
qemu-img convert \
openSUSE-Leap-15.5-Minimal-VM.aarch64-kvm.qcow2 \
openSUSE-Leap-15.5-Minimal-VM.aarch64-kvm.raw

Now you can dd the raw image to disk (make sure /dev/sda is the main disk):

dd if=openSUSE-Leap-15.5-Minimal-VM.aarch64-kvm.qcow2 of=/dev/sda bs=1M

Unmount iso & restart the virtual server. You should see the openSUSE cloud image initial setup :)

Security warning: /etc/ssh/sshd_config has "PermitRootLogin yes". Copy your SSH public key to /root/.ssh/authorized_keys then quickly change the config file to "PermitRootLogin prohibit-password".

Bonus: to extend the root partition:

zypper install growpart
growpart /dev/sda 2

J'ai tout migré sous aarch64 (ou presque)

Rédigé par uTux

Le blog vient de passer sous un sku cax11 chez Hetzner:

  • 2 vCPU Arm64 Ampere® Altra®.
  • 4 GB RAM.
  • 40 GB SSD.
  • 20 TB trafic.
  • NixOS vanilla.

Soit à peu près le double de la version x86 pour le même prix.

Et oui, j'ai bien mentionné NixOS vanilla, ou upstream. Contrairement à l'immense majorité des "bidules" en ARM qui nécessitent un OS spécialement modifié pour pouvoir booter, on a affaire ici à une machine virtuelle QEMU avec un firmware UEFI Tiano Core, qui permet de faire tourner n'importe quelle distribution Linux compilée en aarch64 ! L'installation a été réalisée avec nixos-infect. Voici le résultat d'un uname -a:

Linux prd-web-1 6.1.57 #1-NixOS SMP Tue Oct 10 20:00:46 UTC 2023 aarch64 GNU/Linux

Si j'en ai le courage, je m'attaquerai à la migration de mon serveur Yunohost actuellement en x86. Cela promet d'être laborieux puisque cela nécessite de copier tous mes e-mail, mais cela en vaut la peine.