Alpine armhf VM's?

It looks like there are no Alpine Linux VM images for armhf? Is there any tutorials how to build one?

Replying to myself: it seems that only VM’s of the same architecture are currently possible. I am on x86_64 host.

But is that really the case?

$ incus image list images:alpine armhf -c ldat
+----------------------------+------------------------------------+--------------+-----------+
|           ALIAS            |            DESCRIPTION             | ARCHITECTURE |   TYPE    |
+----------------------------+------------------------------------+--------------+-----------+
| alpine/3.17/armhf (1 more) | Alpine 3.17 armhf (20241104_13:01) | armv7l       | CONTAINER |
+----------------------------+------------------------------------+--------------+-----------+
| alpine/3.17/cloud/armhf    | Alpine 3.17 armhf (20241104_13:00) | armv7l       | CONTAINER |
+----------------------------+------------------------------------+--------------+-----------+
| alpine/3.18/armhf (1 more) | Alpine 3.18 armhf (20241104_13:00) | armv7l       | CONTAINER |
+----------------------------+------------------------------------+--------------+-----------+
| alpine/3.18/cloud/armhf    | Alpine 3.18 armhf (20241104_13:00) | armv7l       | CONTAINER |
+----------------------------+------------------------------------+--------------+-----------+
| alpine/3.19/armhf (1 more) | Alpine 3.19 armhf (20241104_13:02) | armv7l       | CONTAINER |
+----------------------------+------------------------------------+--------------+-----------+
| alpine/3.19/cloud/armhf    | Alpine 3.19 armhf (20241104_13:00) | armv7l       | CONTAINER |
+----------------------------+------------------------------------+--------------+-----------+
| alpine/3.20/armhf (1 more) | Alpine 3.20 armhf (20241104_13:00) | armv7l       | CONTAINER |
+----------------------------+------------------------------------+--------------+-----------+
| alpine/3.20/cloud/armhf    | Alpine 3.20 armhf (20241104_13:02) | armv7l       | CONTAINER |
+----------------------------+------------------------------------+--------------+-----------+
| alpine/edge/armhf (1 more) | Alpine edge armhf (20241104_13:02) | armv7l       | CONTAINER |
+----------------------------+------------------------------------+--------------+-----------+
| alpine/edge/cloud/armhf    | Alpine edge armhf (20241104_13:01) | armv7l       | CONTAINER |
+----------------------------+------------------------------------+--------------+-----------+
$

Yes, it is.

But are there any armhf VMs?

$ incus image list images:armhf -c ldat
+-----------------------------------+----------------------------------------+--------------+-----------+
|               ALIAS               |              DESCRIPTION               | ARCHITECTURE |   TYPE    |
+-----------------------------------+----------------------------------------+--------------+-----------+
| alpine/3.17/armhf (1 more)        | Alpine 3.17 armhf (20241104_13:01)     | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| alpine/3.17/cloud/armhf           | Alpine 3.17 armhf (20241104_13:00)     | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| alpine/3.18/armhf (1 more)        | Alpine 3.18 armhf (20241104_13:00)     | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| alpine/3.18/cloud/armhf           | Alpine 3.18 armhf (20241104_13:00)     | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| alpine/3.19/armhf (1 more)        | Alpine 3.19 armhf (20241104_13:02)     | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| alpine/3.19/cloud/armhf           | Alpine 3.19 armhf (20241104_13:00)     | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| alpine/3.20/armhf (1 more)        | Alpine 3.20 armhf (20241104_13:00)     | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| alpine/3.20/cloud/armhf           | Alpine 3.20 armhf (20241104_13:02)     | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| alpine/edge/armhf (1 more)        | Alpine edge armhf (20241104_13:02)     | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| alpine/edge/cloud/armhf           | Alpine edge armhf (20241104_13:01)     | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| debian/10/armhf (3 more)          | Debian buster armhf (20241104_05:24)   | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| debian/10/cloud/armhf (1 more)    | Debian buster armhf (20241104_05:24)   | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| debian/11/armhf (3 more)          | Debian bullseye armhf (20241104_05:24) | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| debian/11/cloud/armhf (1 more)    | Debian bullseye armhf (20241104_05:36) | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| debian/12/armhf (3 more)          | Debian bookworm armhf (20241104_05:35) | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| debian/12/cloud/armhf (1 more)    | Debian bookworm armhf (20241104_05:24) | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| ubuntu/focal/armhf (3 more)       | Ubuntu focal armhf (20241104_08:01)    | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| ubuntu/focal/cloud/armhf (1 more) | Ubuntu focal armhf (20241104_08:05)    | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| ubuntu/jammy/armhf (3 more)       | Ubuntu jammy armhf (20241104_07:42)    | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| ubuntu/jammy/cloud/armhf (1 more) | Ubuntu jammy armhf (20241104_07:42)    | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| ubuntu/noble/armhf (3 more)       | Ubuntu noble armhf (20241104_07:42)    | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| ubuntu/noble/cloud/armhf (1 more) | Ubuntu noble armhf (20241104_08:03)    | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| ubuntu/oracular/armhf (1 more)    | Ubuntu oracular armhf (20241104_07:42) | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
| ubuntu/oracular/cloud/armhf       | Ubuntu oracular armhf (20241104_08:08) | armv7l       | CONTAINER |
+-----------------------------------+----------------------------------------+--------------+-----------+
$

No, there are no such VM images. But can we build one, using distrobuilder, the alpine configuration, and the distrobuilder appropriate command line parameters found somewhere here?

Sure we can. But,

$ sudo distrobuilder --cache-dir=mycachedir build-dir alpine.yaml rootfs -o image.architecture=armhf -o image.release=edge -o image.variant=cloud -o source.same_as=3.20
INFO   [2024-11-04T22:49:50+02:00] Downloading source                           
/tmp/distrobuilder/alpinelinux-edge-armv7/alpine-minirootfs-3.20.3-armv7.tar.gz: 100% (1.74MB/s))
INFO   [2024-11-04T22:49:53+02:00] Unpacking image                               file=/tmp/distrobuilder/alpinelinux-edge-armv7/alpine-minirootfs-3.20.3-armv7.tar.gz
Error: Error while downloading source: Failed to edit apk repositories: fork/exec /bin/sed: exec format error
ERROR  [2024-11-04T22:49:53+02:00] Failed running distrobuilder                  err="Error while downloading source: Failed to edit apk repositories: fork/exec /bin/sed: exec format error"
INFO   [2024-11-04T22:49:53+02:00] Removing cache directory       
$

It says exec format error. We need an armhf VM in order to generate an Incus armhf VM image for armhf.

Incus does not support running 32bit VM images.
We only build and support 64bit images.