Custom Freebsd Images (13.1) on Oracle Cloud ARM64

Posted on Oct 21, 2022
tl;dr: Roll your own images for use on the free tier of Oracle Cloud

This is a rather terse guide to doing this. I’m assuming you already know what you’re doing with FreeBSD and are comfortable building your own systems from source. If not, go do that now and comeback here….

Download the diff from here.

If that file is not found, it’s probably been updated. You can find the current version on this page.

Apply the diff in /usr/src with

git apply -p0 D34746.diff

Next up you can do a bit of customising to the image. Edit the file '/usr/src/release/tools/oci.conf' and change how you see fit, be sure to increase the disk image size so that everything will fit in it. I’d also recommend changing the username to one that you’d like to use.

Then just run

make buildworld buildkernel TARGET=arm64 TARGET_ARCH=aarch64 KERNCONF=GENERIC 
cd release
make -DNOPORTS -DNOSRC KERNCONF=GENERIC WITH_CLOUDWARE=yes CLOUDWARE=OCI TARGET=arm64 TARGET_ARCH=aarch64 cloudware-release

You’ll end up with a qcow2 image in

/usr/obj/arm64.aarch64/release/

Upload that to a bucket in Object Storage in OCI, then head over to Compute->Custom Images. Add 'VM.Standard.A1.Flex' to that list of 'Compatible Shapes' and deselect all the others.

Edit the 'Image Capabilities', untick the Firmware(BIOS) option and the NIC(VFIO) options. Now you can create a compute instance using the image you selected.

However, if you want to use cli tooling, etc, and be more professional/cloudy about all this, check out this awesome post.