Ubuntu-image boot pi image

Hi,

I have created a custom image using ubuntu-image for pi ubuntu 22

The image is created pi.img. How do I create a VM from it? The custom image don’t have any partitions.

fdisk -l pi.img 
Disk pi.img: 8.42 GiB, 9038725120 bytes, 17653760 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xeef853f0

Device     Boot Start     End Sectors  Size Id Type
pi.img1          2048 2459647 2457600  1.2G  c W95 FAT32 (LBA)
fdisk -l ~/Downloads/ubuntu-core-22-arm64.img 
Disk /home/ubuntu/Downloads/ubuntu-core-22-arm64.img: 8.61 GiB, 9248440320 bytes, 18063360 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 7CEC9013-A76C-400F-BD83-EBF89CCFC0C3

Device                                             Start      End  Sectors  Size Type
/home/ubuntu/Downloads/ubuntu-core-22-arm64.img1    2048  2459647  2457600  1.2G EFI System
/home/ubuntu/Downloads/ubuntu-core-22-arm64.img2 2459648  3995647  1536000  750M Linux filesystem
/home/ubuntu/Downloads/ubuntu-core-22-arm64.img3 3995648  4061183    65536   32M Linux filesystem
/home/ubuntu/Downloads/ubuntu-core-22-arm64.img4 4061184 18063326 14002143  6.7G Linux filesystem
{
    "type": "model",
    "series": "16",
    "model": "jake-core-22-pi-arm64",
    "architecture": "arm64",
    "authority-id": "JZA65Eb6C3J6AyFTyAQdmmlCZfhSbROp",
    "brand-id": "JZA65Eb6C3J6AyFTyAQdmmlCZfhSbROp",
    "timestamp": "2024-04-04T10:40:41+00:00",
    "base": "core22",
    "grade": "signed",
    "snaps": [
        {
            "name": "pi",
            "type": "gadget",
            "default-channel": "22/stable",
            "id": "YbGa9O3dAXl88YLI6Y1bGG74pwBxZyKg"
        },
        {
            "name": "pi-kernel",
            "type": "kernel",
            "default-channel": "22/stable",
            "id": "jeIuP6tfFrvAdic8DMWqHmoaoukAPNbJ"
        },
        {
            "name": "core22",
            "type": "base",
            "default-channel": "latest/stable",
            "id": "amcUKQILKXHHTlmSa7NMdnXSx02dNeeT"
        },
        {
            "name": "snapd",
            "type": "snapd",
            "default-channel": "latest/stable",
            "id": "PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4"
        },
        {
            "name": "mesa-core22",
            "type": "app",
            "default-channel": "latest/stable",
            "id": "UijXdFgvIKp9ZZ6P4ijPAJHWZLtSKgWm"
        },
        {
            "name": "ubuntu-frame",
            "type": "app",
            "default-channel": "22/stable",
            "id": "BPZbvWzvoMTrpec4goCXlckLe2IhfthK"
        },
        {
            "name": "docker",
            "type": "app",
            "default-channel": "latest/stable",
            "id": "sLCsFAO8PKM5Z0fAKNszUOX0YASjQfeZ"
        }
    ]
}

You didn’t download a -raspi image… these arm64 images are for devices that can use UEFI… the pi images use in fact a single vfat partition on first boot.

I also think there doesn’t exist any VM software that can emulate the proprietary HW of the rpi nor the closed source bootloader, you will have to test it on real hardware…

How do I create an ARM64 image? Is there ARM gadge snap?

Well, if you actually own any UEFI capable arm64 hardware (typically pretty big iron servers) you can just use the respective model assertion next to the image you downloaded …

Which is likely this one for the image above:

https://cdimage.ubuntu.com/ubuntu-core/22/stable/current/ubuntu-core-22-arm64.model-assertion

FTR you can find instructions on how to run uefi arm64 images on qemu in Test Ubuntu Core with QEMU | Ubuntu

1 Like