DOKK / manpages / debian 11 / sbuild-qemu / sbuild-qemu-create.1.en
SBUILD-QEMU-CREATE(1) Debian sbuild SBUILD-QEMU-CREATE(1)

sbuild-qemu-create - QEMU image creator for sbuild

sbuild-qemu-create [-h] [--arch=ARCH] [--install-packages=INSTALL_PACKAGES] [--extra-deb=EXTRA_DEB] [--components=COMPONENTS] [--skel=SKEL] [--size=SIZE] [-o=OUT_FILE] [--noexec] debmirror

Build an image for use with sbuild-qemu and autopkgtest. distribution will be debootstrapped using mirror debmirror. Note that the mirror will also be used for the sources.list file in the VM. See MIRROR below.

Note that sbuild-qemu-create is just a simple wrapper around autopkgtest-build-qemu(1) that automates a few additional steps commonly performed with package-building images.

Show this help message and exit.
Architecture to use. Default is the host architecture. Currently supported architectures are: amd64, i386.
Comma-separated list of additional packages to install using apt-get install from within the running image.
Package file (.deb) from the local filesystem to install. Can be specified more than once.
Comma-separated list of components to use with sources.list entries. Default: main.
Skeleton directory to use for /root.
VM size to use. Note that the images will be created in qcow2 format, so they won't consume that space right away. Default: 10G.
Output filename. If not supplied, then DIST-autopkgtest-ARCH.img will be used.
Don't actually do anything. Just print the autopkgtest-build-qemu(1) command string that would be executed, and then exit.

It is highly recommended that you use an APT cache, like approx(8), or apt-cacher-ng(8), on the local machine (so that the VM guest can access it without much hassle) as a mirror. This will dramatically speed up the package build process. On the author's local machine, installing the build dependencies of even larger packages takes only a few seconds.

If the distribution is experimental, sources.list will contain entries for both experimental and unstable.

If the distribution ends with -backports, sources.list will contain entries for both the distribution and the distribution it is based upon.

Among other things, autopkgtest-virt-qemu(1) has built-in support for sharing a directory on the host with the guest, so no further configuration should be necessary when accessing the VM using autopkgtest.

However, for cases where the VM is launched via QEMU directly, a /shared mount point for a 9p filesystem has been added to the VM's /etc/fstab. It is configured with the nofail option, so it will be ignored if nothing is being shared.

To share a directory on the host with the VM, QEMU should be started with the following additional options:

-virtfs path=/path/to/host/dir,local,id=shared,mount_tag=shared,security_model=none

$ sudo sbuild-qemu-create unstable http://deb.debian.org/debian

This will create an image unstable-autopkgtest-amd64.img (assuming that the host architecture is amd64) with the unstable distribution.

$ sudo sbuild-qemu-create buster-backports http://deb.debian.org/debian

This will create an image buster-backports-autopkgtest-amd64.img, with sources.list entries for both buster and buster-backports.

$ sudo sbuild-qemu-create --skel DIR unstable http://deb.debian.org/debian

The files in DIR will be copied into /root (that is, root's $HOME). This can be used, for example, to copy an .ssh/authorized_keys file, so that one can connect to the running image using SSH (assuming openssh-server is installed).

$ sudo sbuild-qemu-create --install-packages openssh-server unstable http://deb.debian.org/debian

This would install openssh-server. The package will be downloaded in the target environment using 'apt-get'.

A popular package to pre-install this way would be debhelper, as it is a build dependency of the vast majority of Debian packages.

$ sudo sbuild-qemu-create --extra-deb FOO.deb unstable http://deb.debian.org/debian

This would install the package FOO.deb from the local filesystem. Useful, for example, to install additional keyring packages.

$ sudo sbuild-qemu-create --shared-mountpoint unstable http://deb.debian.org/debian

This will create an image with an fstab entry for the directory /shared.

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

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

31 August 2022 Version 0.81.2+deb11u1