SBUILD-QEMU(1)

πŸ’– SBUILD-QEMU(1) πŸ’–

okay bestie, so this is sbuild-qemu, from the Debian sbuild manual pages β€” it's the whole "build packages with sbuild but the chroot is a QEMU image" situation. it's giving main character energy and honestly? obsessed.


✨ NAME ✨

sbuild-qemu β€” sbuild, but make it QEMU images πŸ¦‹


🌸 SYNOPSIS 🌸

sbuild-qemu [-h] [--image=IMAGE] [--ram-size=MiB] [--cpus=CPUs]
[--overlay-dir=OVERLAY_DIR] [--noexec] [--autopkgtest-debug] [<sbuild-options>]

Build Debian packages with sbuild using QEMU images, by using sbuild's --chroot-mode=autopkgtest. that's the whole vibe. πŸ’…

So like, every option that is not one of the ones described down below just gets passed through to sbuild(1), no drama. BUT β€” the options --dist, --arch and --build get peeked at πŸ‘€ when it's hunting for images. The image gets started in -snapshot mode, so the image is never modified β€” which means multiple processes can use the same image concurrently. no fighting, no jealousy, sharing is caring. 🫢


πŸŽ€ OPTIONS πŸŽ€

  • -h, --help β€” shows this help message and dips out. bye. ✌️
  • --image=IMAGE β€” the QEMU image file you wanna use for building. If you don't specify it, sbuild-qemu goes looking for an image named DIST-autopkgtest-ARCH.img, where DIST comes from --dist if it's there, and ARCH comes from --arch or --build if they're there. If none of that exists, DIST defaults to 'unstable' and ARCH defaults to the host architecture. It checks the current directory for that image first, and then the directory $IMAGEDIR. oh and if you need to make a suitable image, that's what sbuild-qemu-create(1) is for. ✨
  • --ram-size=MiB β€” VM memory size in MB. Default: 2048
  • --cpus=CPUs β€” VM CPU count. Default: 2
  • --overlay-dir=OVERLAY_DIR β€” directory for the temporary image overlay, instead of autopkgtest's default of /tmp (or $TMPDIR).
  • --noexec β€” don't actually do anything. like, at all. just print the sbuild(1) command string that would have been executed, then exit. window shopping, basically. πŸ›οΈ
  • --autopkgtest-debug β€” turns on debug output for the autopkgtest-virt-qemu(1) driver.
  • --boot=auto,bios,efi,ieee1275,none β€” how to boot the image. Default is BIOS on amd64 and i386, EFI on arm64 and armhf, and IEEE1275 on ppc64el.

🧚 CONSIDERATIONS 🧚

Using a fast temporary image overlay is key to faster build times. An overlay created on a tmpfs would be ideal, and it can speed up I/O by an order of magnitude compared to a slow HDD. If /tmp or $TMPDIR are mountpoints for a tmpfs, then everything should be fine by default. slay. πŸ’–

HOWEVER β€” tmpfs filesystems are backed by memory and swap on the host, so a build that needs substantial disk space in the VM may fail. 😭 If that happens, you should use the --overlay-dir option to point at a host directory with more available disk space. Also note that the base image itself must have been created with a suitable size β€” see the --size option to sbuild-qemu-create(1).


πŸ’€ LIMITATIONS πŸ’€

Because of the nature of sbuild's --chroot-mode=autopkgtest, not all sbuild options are supported yet. In particular, getting an interactive shell β€” for example using --build-failed-command β€” is NOT possible. nope. not happening. πŸ™ˆ

But bestie, don't spiral β€” there are other ways to access the build environment (see below πŸ‘‡).


🌈 VM ACCESS 🌈

sbuild's --chroot-mode=autopkgtest uses autopkgtest-virt-qemu under the hood, so you'll find an SSH shell on port 10022 (or the first free port after that) if, and only if, the openssh-server package is installed in the VM.

And as a further consequence of this chroot mode, what is stated in autopkgtest-virt-qemu(1) generally also holds here. iykyk. 🀝


⭐ EXAMPLES ⭐

$ sbuild-qemu -d unstable -s --arch-all FOO.dsc

This will build the package FOO.dsc using unstable as the Distribution in the generated .changes file.

Because the --image option was not specified, an image with the name unstable-autopkgtest-amd64.img will be looked for first in the current directory, and then in $IMAGEDIR.

The -s and --arch-all aren't known to sbuild-qemu, so they'll be passed on through to sbuild for it to use. teamwork makes the dream work. 🫢


πŸ“ ENVIRONMENT πŸ“

$IMAGEDIR defaults to ~/.cache/sbuild.


Copyright Β© 2020-2022 Christian Kastner <ckk@debian.org>


πŸ”₯ SEE ALSO πŸ”₯

sbuild(1), sbuild-qemu-create(1), sbuild-qemu-update(1).


and that's the tea, bestie β€” Version 0.91.10ubuntu1, dated 29 June 2026, straight from the Debian sbuild crew. now go build something iconic. periodt. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from