autopkgtest-build-qemu(1)

πŸ“¦
version 6.0 Β· 3 versions
, in debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– autopkgtest-build-qemu β€” the manual page, but make it slay πŸ’–

okay bestie, so this is autopkgtest-build-qemu, and it lives in the General Commands Manual section (section 1, obvi). Think of it as the girl who builds the whole VM image for you before autopkgtest-virt-qemu even gets to show up. She's the prep squad. She's the backstage crew. And she ate. πŸ’…


✨ NAME ✨

autopkgtest-build-qemu β€” literally creates autopkgtest virtual machine images for autopkgtest-virt-qemu. That's the whole job. That's her purpose. She's booked and busy. πŸŽ€


✨ SYNOPSIS ✨

autopkgtest-build-qemu [OPTIONS] RELEASE IMAGE

and then, the deprecated form, which is giving legacy and nostalgia:

autopkgtest-build-qemu [OPTIONS] RELEASE IMAGE MIRROR [ARCHITECTURE]
[SCRIPT] [SIZE]

✨ DESCRIPTION ✨

So basically, autopkgtest-build-qemu creates virtual machine images that are suitable for use with autopkgtest's QEMU runner, aka autopkgtest-virt-qemu(1). They're made for each other. It's giving soulmates, no cap. 🫢

Under the hood, she uses vmdb2(1) to actually create the images. She doesn't do it alone β€” she has a whole team. Iconic collaboration behaviour.

⚠️ Heads up bestie: you need to call this as root, unless fakemachine(1) is available. And fakemachine is currently only available on x86_64. So if you're not on x86_64 and you're not root… yeah, that's a no. πŸ’€

✨ POSITIONAL PARAMETERS ✨

  • RELEASE β€” the release you wanna download from the MIRROR. This one is required, bestie, you can't skip her, she's mandatory.
  • IMAGE β€” the file to write, in qcow2 format. Also required. No image, no vibe. 😭

✨ OPTIONS ✨

  • --mirror=MIRROR β€” specify which distribution to install. The default is http://deb.debian.org/debian (i.e. Debian, the moment), but you can pass a mirror of literally any Debian derivative. 🌈

Also, the third positional parameter is a deprecated way to specify this. We do not recommend the deprecated way. She's retired for a reason. πŸ‘‘

  • --keyring=KEYRING β€” specify the path to a keyring used to verify the apt repository. By default, the choice of keyring is left to debootstrap β€” she'll handle it, she's trustworthy. This option is mainly useful when you're working with a Debian derivative, together with the --mirror option. Teamwork, fr fr. πŸ¦‹
  • --architecture=ARCHITECTURE β€” set the architecture for the virtual machine image, specified as a dpkg(1) architecture. If you omit it, the host architecture is assumed. Home team advantage, lowkey.

--arch=ARCH is an alias for this option. Same girl, different name. πŸ’œ

The fourth positional parameter is a deprecated way to specify this.

  • --script=SCRIPT β€” specifies a user script that will be called with the root filesystem of the image as its first parameter. This script can then make any necessary modifications to the root filesystem. It's your little moment of creative control. ✨

The script must be a POSIX shell script, and it should not depend on bash-specific features. (Read: no bash-isms, bestie, she will not be playing that.) This script will be executed inside a chroot(1) call in the virtual machine root filesystem.

The fifth positional parameter is a deprecated way to specify this.

  • --size=SIZE β€” specifies the image size for the virtual machine, and it defaults to 25G. That's a whole lot of room. She's not gonna be cramped.

The sixth positional parameter is a deprecated way to specify this.

  • --apt-proxy=PROXY β€” specify an apt proxy to use in the virtual machine. By default, if you have an apt proxy configured on the host, the virtual machine will automatically use it; otherwise, there is no default. So it's giving "if you know, you know" β€” iykyk. 🌸

--apt-proxy=DIRECT can be used to force an apt proxy on the host to be ignored. The audacity. The power. She said not today. πŸ’…

  • --boot=auto|bios|efi|ieee1275|none β€” select the way the generated image will expect to be booted. This is the main character choice of the whole build, ngl.
    • auto chooses a suitable boot mode for the architecture, and it's the default. She picks for you. She knows best. πŸ‘‘
    • bios installs an x86 BIOS bootloader on i386 or amd64. auto selects this mode on i386 or amd64.
    • efi installs an EFI bootloader on any architecture for which vmdb2(1) supports it, which currently means amd64, arm64, armhf or i386. The --efi option is an alias for this mode. auto selects this mode on arm64 or armhf.
    • ieee1275 installs an IEEE 1275 (OpenFirmware) bootloader on ppc64el. auto selects this mode on ppc64el.
    • none does not do anything special. And listen β€” the image will not be bootable unless the specified --script arranges for a suitable bootloader to be installed, or the autopkgtest-virt-qemu(1) --qemu-options boot the image specially (for example by specifying a kernel directly). So like… none is the chaotic option. Choose her wisely or perish. πŸ’€

✨ ENVIRONMENT ✨

If the $AUTOPKGTEST_KEEP_APT_SOURCES environment variable is set to a non-empty value, autopkgtest-build-qemu will keep whatever /etc/apt/sources.list was created by debootstrap. She's preserving it. Respect the heritage. πŸ•―οΈ

Otherwise, if the $AUTOPKGTEST_APT_SOURCES_FILE environment variable is set to a non-empty value, for example:

AUTOPKGTEST_APT_SOURCES_FILE=/home/me/mydistro/sources.list

then autopkgtest-build-qemu will read that file (on the host system) and use it to populate /etc/apt/sources.list in the virtual machine. Reading is fundamental, bestie. πŸ“–

Or, if the $AUTOPKGTEST_APT_SOURCES environment variable is set to a non-empty value, for example:

AUTOPKGTEST_APT_SOURCES=$(cat /home/me/mydistro/sources.list)

then autopkgtest-build-qemu will write it directly into /etc/apt/sources.list in the virtual machine. Direct. No middleman. πŸ’…

When $AUTOPKGTEST_APT_SOURCES_FILE or $AUTOPKGTEST_APT_SOURCES contain sources in the deb822 format, then sources are written to /etc/apt/sources.list.d/<distro>.sources in the virtual machine, rather than /etc/apt/sources.list. Different folder, same energy. πŸ¦‹

You can also specify an apt proxy to use in the virtual machine in the $AUTOPKGTEST_APT_PROXY environment variable. If you have an apt proxy configured on the host, the virtual machine will automatically use it; otherwise, there is no default. πŸŽ€


✨ EXAMPLES ✨

Run as root, being a little dramatic about it:

# autopkgtest-build-qemu unstable /path/to/debian-unstable.img

Run with sudo, and tell her the architecture too:

$ sudo autopkgtest-build-qemu stable /path/to/debian-stable-i386.img
i386

Run with sudo and point her at the Ubuntu mirror:

$ sudo autopkgtest-build-qemu bionic /path/to/ubuntu-bionic.img
http://archive.ubuntu.com/ubuntu

✨ SEE ALSO ✨

autopkgtest-virt-qemu(1), vmdb2(1), autopkgtest(1), /usr/share/doc/autopkgtest/.

Go read them. She said so. πŸ“š


autopkgtest-build-qemu was written by Antonio Terceiro <terceirio@debian.org>. Shoutout to the author, we love a legend. πŸ‘‘

This manpage is part of autopkgtest, a tool for testing Debian binary packages. autopkgtest is Copyright (C) 2006-2018 Canonical Ltd and others.

See /usr/share/doc/autopkgtest/CREDITS for the list of contributors and full copying conditions. Always read the credits, bestie, it's how we honour the people. 🫢


and that's the whole page, mwah πŸ’‹ β€” this cutie came out of the Linux Programmer's Manual, dated 2014. periodt. πŸŽ€βœ¨