Mkosi for Arch Boxes


  • how do we make profiles?

    • profile for basic
    • profile for cloud-init
    • profile for vagrant and vagrant-libvirt
  • how do we make btrfs partition of 40GB for basic

  • how do I add a user with sudo? =>

  • how do I cache the package manager step

  • how do I create a qcow2 after the final step? => mkosi.postoutput

  • do we need to remove /etc/machine-id?

  • How do we apply sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"rootflags=compress-force=zstd\"/' "${MOUNT}/etc/default/grub"

  • Can we boot test in CI? Check if swap is enabled etc.? Systemd units run? systemctl --failed is green?




  • mkosi
  • systemd-ukify
  • grub
  • btrfs-progs


cd projects/arch-boxes/cloud-init-image
mkdir mkosi.{cache,output}
mkosi build


Traceback (most recent call last):
  File "/home/jelle/projects/mkosi/mkosi/", line 60, in uncaught_exception_handler
  File "/home/jelle/projects/mkosi/mkosi/", line 101, in fork_and_wait
    target(*args, **kwargs)
  File "/home/jelle/projects/mkosi/mkosi/", line 4637, in run_build
    build_image(Context(args, config, workspace=workspace, resources=resources))
  File "/home/jelle/projects/mkosi/mkosi/", line 3833, in build_image
  File "/home/jelle/projects/mkosi/mkosi/", line 1460, in install_grub
    grub_mkimage(context, target="i386-pc", modules=("biosdisk",))
  File "/home/jelle/projects/mkosi/mkosi/", line 1371, in grub_mkimage
    assert mkimage
  • Lack of grub on my system, but assert could tell me that :)

Should mkosi qemu read BiosBootLoader options and then use mkosi --qemu-firmware bios qemu

How to exit QEMU? Maybe add ctrl+] support like nspawn?

modifications in mkosi qemu stay, seems somewhat unexpected