SBUILD-QEMU-CREATE(1)

NAME
sbuild-qemu-create - QEMU image creator for sbuild

SYNOPSIS
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.

OPTIONS

-h, --help
    Show this help message and exit.

--arch=ARCH
    Architecture to use. Default is the host architecture. Currently supported architectures are: amd64, i386.

--install-packages=INSTALL_PACKAGES
    Comma-separated list of additional packages to install using apt-get install from within the running image.

--extra-deb=EXTRA_DEB
    Package file (.deb) from the local filesystem to install. Can be specified more than once.

--components=COMPONENTS
    Comma-separated list of components to use with sources.list entries. Default: main.

--skel=SKEL
    Skeleton directory to use for /root.

--size=SIZE
    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.

-o=OUT_FILE, --out-file=OUT_FILE
    Output filename. If not supplied, then DIST-autopkgtest-ARCH.img will be used.

--noexec
    Don't actually do anything. Just print the autopkgtest-build-qemu(1) command string that would be executed, and then exit.

MIRROR
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.

SPECIAL CASES
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.

SHARING FILES
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

EXAMPLES
$ 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
Copyright © 2020 Christian Kastner <ckk@debian.org>

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