I know that it must be possible to have the same alias for a container image and a VM image simultaneously, because the public images:
server does this:
$ incus image list images: ubuntu/22.04/cloud
+-----------------------------------+--------------+--------+-------------------------------------+--------------+-----------------+-----------+----------------------+
| ALIAS | FINGERPRINT | PUBLIC | DESCRIPTION | ARCHITECTURE | TYPE | SIZE | UPLOAD DATE |
+-----------------------------------+--------------+--------+-------------------------------------+--------------+-----------------+-----------+----------------------+
| ubuntu/jammy/cloud (3 more) | 0e2ef69d7367 | yes | Ubuntu jammy amd64 (20240328_09:31) | x86_64 | CONTAINER | 137.29MiB | 2024/03/28 00:00 UTC |
+-----------------------------------+--------------+--------+-------------------------------------+--------------+-----------------+-----------+----------------------+
| ubuntu/jammy/cloud (3 more) | e8f4af613cd6 | yes | Ubuntu jammy amd64 (20240328_09:31) | x86_64 | VIRTUAL-MACHINE | 293.96MiB | 2024/03/28 00:00 UTC |
+-----------------------------------+--------------+--------+-------------------------------------+--------------+-----------------+-----------+-------
...
But I can’t work out how to do this locally.
$ incus image list
+----------+--------------+--------+---------------------------------------------+--------------+-----------------+------------+----------------------+
| ALIAS | FINGERPRINT | PUBLIC | DESCRIPTION | ARCHITECTURE | TYPE | SIZE | UPLOAD DATE |
+----------+--------------+--------+---------------------------------------------+--------------+-----------------+------------+----------------------+
| nmm-base | 65f695728219 | yes | Ubuntu jammy amd64 (cloud) (20240328_09:31) | x86_64 | CONTAINER | 296.21MiB | 2024/03/28 21:08 UTC |
+----------+--------------+--------+---------------------------------------------+--------------+-----------------+------------+----------------------+
| nsrc-nmm | 07a0e7cd6107 | yes | | x86_64 | VIRTUAL-MACHINE | 2116.18MiB | 2024/03/29 08:34 UTC |
+----------+--------------+--------+---------------------------------------------+--------------+-----------------+------------+----------------------+
$ incus image alias create foobar 65f695728219
$ incus image alias create foobar 07a0e7cd6107 --vm
Error: unknown flag: --vm
$ incus image alias create foobar 07a0e7cd6107
Error: Alias "foobar" already exists
What am I missing?