Scroll to navigation

QEMU-SBUILD-CREATE(1) User Commands QEMU-SBUILD-CREATE(1)

NAME

qemu-sbuild-create - QEMU image creator for sbuild

DESCRIPTION

usage: qemu-sbuild-create [-h] [--arch ARCH]

[--install-packages INSTALL_PACKAGES]
[--extra-deb EXTRA_DEB] [--components COMPONENTS] [--skel SKEL] [--size SIZE] [-o OUT_FILE] [--noexec] distribution mirror

Builds images for use with qemu-sbuild and autopkgtest.

positional arguments:

The distribution to debootstrap.
The mirror to use for the installation. Note that the mirror will also be used for the sources.list file in the VM. See MIRROR below.

optional arguments:

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 in the image using 'apt-get install'.
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 are in qcow2 format, so they won't consume that space right away. Default: 10G.
Output filename. If not supplied, then DISTautopkgtest-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.

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

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) 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 its base.

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 qemu-sbuild-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 qemu-sbuild-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 qemu-sbuild-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 qemu-sbuild-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 qemu-sbuild-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 qemu-sbuild-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@kvr.at>

SEE ALSO

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

December 2020 qemu-sbuild-create 0.1