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] [RELEASE] [MIRROR]
Build an image for use with sbuild-qemu and autopkgtest. RELEASE will be debootstrapped from MIRROR. Note that the same mirror will also be used for the sources.list file within 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 for package-building images.
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 can access that cache 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 you use a local cache, then ensure that the mirror is accessible from within the guest. Using http://localhost:9999/debian or similar will successfully build the image, but APT will fail within the running VM, because to the VM, ``localhost'' is something else. An easy workaround is to use an IP address instead, for example http://192.168.0.123:9999/debian, assuming the host system has the IP 192.168.0.123.
If RELEASE is experimental, sources.list will contain entries for both experimental and unstable.
If RELEASE ends with -backports, sources.list will contain entries for both RELEASE and for the distribution it is based upon. In other words, specifying bullseye-backports will also add an entry for bullseye.
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.
In additon to that, a mount point for a 9p filesystem is added to the VM's /etc/fstab. This is for cases where the VM is launched via QEMU directly, rather than going through autopkgtest-virt-qemu.
To share a directory on the host with the VM, QEMU should be started with the following additional options:
-virtfs local,path=/path/to/host/dir,id=sbuild-qemu,mount_tag=sbuild-qemu,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 bullseye-backports http://deb.debian.org/debian
This will create an image bullseye-backports-autopkgtest-amd64.img, with sources.list entries for both bullseye and bullseye-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.
Copyright © 2020-2022 Christian Kastner <ckk@debian.org>
04 January 2023 | Version 0.85.0 |