#1013436 autopkgtest: Building of qemu images fails

Package:
autopkgtest
Source:
autopkgtest
Submitter:
"Roberto C. Sanchez"
Date:
2026-03-05 19:53:02 UTC
Severity:
important
Tags:
#1013436#5
Date:
2022-06-23 15:50:59 UTC
From:
To:
Attempting to build qemu images fails as follows:

roberto@debian:~$ sudo autopkgtest-build-qemu buster ./autopkgtest-buster.img
Load spec file /tmp/user/0/tmph19aaviw/vmdb2.yaml
Exec: ['dpkg', '--print-architecture']
Exec: ['qemu-img', 'create', '-f', 'raw', './autopkgtest-buster.img.raw', '25G']
Exec: ['parted', '-s', './autopkgtest-buster.img.raw', 'mklabel', 'msdos']
Exec: ['parted', '-m', '/home/roberto/autopkgtest-buster.img.raw', 'print']
Exec: ['parted', '-s', '/home/roberto/autopkgtest-buster.img.raw', '--', 'mkpart', 'primary', 'ext2', '0%', '100%']
Exec: ['parted', '-m', '/home/roberto/autopkgtest-buster.img.raw', 'print']
Exec: ['kpartx', '-asv', './autopkgtest-buster.img.raw']
remembering /dev/mapper/loop0p1 as root
Exec: ['/sbin/mkfs', '-t', 'ext4', '/dev/mapper/loop0p1']
Exec: ['mount', '/dev/mapper/loop0p1', '/tmp/user/0/tmpllucvne5']
Exec: ['debootstrap', '--variant', '-', 'buster', '/tmp/user/0/tmpllucvne5', 'http://deb.debian.org/debian']
Exec: ['chroot', '/tmp/user/0/tmpllucvne5', 'apt-get', 'update']
Exec: ['chroot', '/tmp/user/0/tmpllucvne5', 'apt-get', 'update']
Exec: ['chroot', '/tmp/user/0/tmpllucvne5', 'apt-get', '-y', '--no-show-progress', 'install', 'eatmydata']
Exec: ['chroot', '/tmp/user/0/tmpllucvne5', 'eatmydata', 'apt-get', 'update']
Exec: ['chroot', '/tmp/user/0/tmpllucvne5', 'eatmydata', 'apt-get', '-y', '--no-show-progress', 'install', 'linux-image-amd64', 'ifupdown']
ERROR:root:Program failed: 100
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/vmdb/app.py", line 220, in run_steps_helper
    method(values, settings, state)
  File "/usr/lib/python3/dist-packages/vmdb/plugins/apt_plugin.py", line 47, in run
    self.install_packages(mount_point, ["eatmydata"], packages)
  File "/usr/lib/python3/dist-packages/vmdb/plugins/apt_plugin.py", line 61, in install_packages
    vmdb.runcmd_chroot(
  File "/usr/lib/python3/dist-packages/vmdb/runcmd.py", line 64, in runcmd_chroot
    return runcmd(full_argv, *argvs, **kwargs)
  File "/usr/lib/python3/dist-packages/vmdb/runcmd.py", line 58, in runcmd
    raise RuncmdError("Program failed: {}".format(p.returncode))
vmdb.runcmd.RuncmdError: Program failed: 100
ERROR: Program failed: 100
ERROR:root:RuncmdError('Program failed: 100')
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/vmdb/app.py", line 220, in run_steps_helper
    method(values, settings, state)
  File "/usr/lib/python3/dist-packages/vmdb/plugins/apt_plugin.py", line 47, in run
    self.install_packages(mount_point, ["eatmydata"], packages)
  File "/usr/lib/python3/dist-packages/vmdb/plugins/apt_plugin.py", line 61, in install_packages
    vmdb.runcmd_chroot(
  File "/usr/lib/python3/dist-packages/vmdb/runcmd.py", line 64, in runcmd_chroot
    return runcmd(full_argv, *argvs, **kwargs)
  File "/usr/lib/python3/dist-packages/vmdb/runcmd.py", line 58, in runcmd
    raise RuncmdError("Program failed: {}".format(p.returncode))
vmdb.runcmd.RuncmdError: Program failed: 100
ERROR: RuncmdError('Program failed: 100')
Something went wrong, cleaning up!
Exec: ['kpartx', '-dsv', './autopkgtest-buster.img.raw']
ERROR:root:An error occurred, exiting
Command '['/usr/bin/vmdb2', '--verbose', '--image=./autopkgtest-buster.img.raw', '/tmp/user/0/tmph19aaviw/vmdb2.yaml']' returned non-zero exit status 1.

roberto@debian:~$ sudo autopkgtest-build-qemu stretch ./autopkgtest-stretch.img
Load spec file /tmp/user/0/tmpxxdr1xfo/vmdb2.yaml
Exec: ['dpkg', '--print-architecture']
Exec: ['qemu-img', 'create', '-f', 'raw', './autopkgtest-stretch.img.raw', '25G']
Exec: ['parted', '-s', './autopkgtest-stretch.img.raw', 'mklabel', 'msdos']
Exec: ['parted', '-m', '/home/roberto/autopkgtest-stretch.img.raw', 'print']
Exec: ['parted', '-s', '/home/roberto/autopkgtest-stretch.img.raw', '--', 'mkpart', 'primary', 'ext2', '0%', '100%']
Exec: ['parted', '-m', '/home/roberto/autopkgtest-stretch.img.raw', 'print']
Exec: ['kpartx', '-asv', './autopkgtest-stretch.img.raw']
remembering /dev/mapper/loop0p1 as root
Exec: ['/sbin/mkfs', '-t', 'ext4', '/dev/mapper/loop0p1']
Exec: ['mount', '/dev/mapper/loop0p1', '/tmp/user/0/tmp54sylmnp']
Exec: ['debootstrap', '--variant', '-', 'stretch', '/tmp/user/0/tmp54sylmnp', 'http://deb.debian.org/debian']
Exec: ['chroot', '/tmp/user/0/tmp54sylmnp', 'apt-get', 'update']
Exec: ['chroot', '/tmp/user/0/tmp54sylmnp', 'apt-get', 'update']
Exec: ['chroot', '/tmp/user/0/tmp54sylmnp', 'apt-get', '-y', '--no-show-progress', 'install', 'eatmydata']
Exec: ['chroot', '/tmp/user/0/tmp54sylmnp', 'eatmydata', 'apt-get', 'update']
Exec: ['chroot', '/tmp/user/0/tmp54sylmnp', 'eatmydata', 'apt-get', '-y', '--no-show-progress', 'install', 'linux-image-amd64', 'ifupdown']
Exec: ['chroot', '/tmp/user/0/tmp54sylmnp', 'apt-get', 'clean']
Installing GRUB for BIOS
Exec: ['mount', '--bind', '/dev', '/tmp/user/0/tmp54sylmnp/dev']
Exec: ['mount', '--bind', '/sys', '/tmp/user/0/tmp54sylmnp/sys']
Exec: ['mount', '--bind', '/proc', '/tmp/user/0/tmp54sylmnp/proc']
Exec: ['chroot', '/tmp/user/0/tmp54sylmnp', 'apt-get', '-y', '--no-show-progress', 'install', 'grub-pc']
ERROR:root:Program failed: 100
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/vmdb/app.py", line 220, in run_steps_helper
    method(values, settings, state)
  File "/usr/lib/python3/dist-packages/vmdb/plugins/grub_plugin.py", line 105, in run
    self.install_bios(values, settings, state)
  File "/usr/lib/python3/dist-packages/vmdb/plugins/grub_plugin.py", line 139, in install_bios
    self.install_grub(values, settings, state, grub_package, grub_target)
  File "/usr/lib/python3/dist-packages/vmdb/plugins/grub_plugin.py", line 184, in install_grub
    self.install_package(chroot, grub_package)
  File "/usr/lib/python3/dist-packages/vmdb/plugins/grub_plugin.py", line 288, in install_package
    vmdb.runcmd_chroot(
  File "/usr/lib/python3/dist-packages/vmdb/runcmd.py", line 64, in runcmd_chroot
    return runcmd(full_argv, *argvs, **kwargs)
  File "/usr/lib/python3/dist-packages/vmdb/runcmd.py", line 58, in runcmd
    raise RuncmdError("Program failed: {}".format(p.returncode))
vmdb.runcmd.RuncmdError: Program failed: 100
ERROR: Program failed: 100
ERROR:root:RuncmdError('Program failed: 100')
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/vmdb/app.py", line 220, in run_steps_helper
    method(values, settings, state)
  File "/usr/lib/python3/dist-packages/vmdb/plugins/grub_plugin.py", line 105, in run
    self.install_bios(values, settings, state)
  File "/usr/lib/python3/dist-packages/vmdb/plugins/grub_plugin.py", line 139, in install_bios
    self.install_grub(values, settings, state, grub_package, grub_target)
  File "/usr/lib/python3/dist-packages/vmdb/plugins/grub_plugin.py", line 184, in install_grub
    self.install_package(chroot, grub_package)
  File "/usr/lib/python3/dist-packages/vmdb/plugins/grub_plugin.py", line 288, in install_package
    vmdb.runcmd_chroot(
  File "/usr/lib/python3/dist-packages/vmdb/runcmd.py", line 64, in runcmd_chroot
    return runcmd(full_argv, *argvs, **kwargs)
  File "/usr/lib/python3/dist-packages/vmdb/runcmd.py", line 58, in runcmd
    raise RuncmdError("Program failed: {}".format(p.returncode))
vmdb.runcmd.RuncmdError: Program failed: 100
ERROR: RuncmdError('Program failed: 100')
Something went wrong, cleaning up!
Exec: ['kpartx', '-dsv', './autopkgtest-stretch.img.raw']
ERROR:root:An error occurred, exiting
Command '['/usr/bin/vmdb2', '--verbose', '--image=./autopkgtest-stretch.img.raw', '/tmp/user/0/tmpxxdr1xfo/vmdb2.yaml']' returned non-zero exit status 1.

I also tried updating to the latest autopkgtest (5.22) and vmdb2
(0.26-1), with the essentially the same results.

Regards,

- -Roberto

- -- System Information:
Debian Release: 11.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-14-amd64 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_FIRMWARE_WORKAROUND
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages autopkgtest depends on:
ii  apt-utils       2.2.4
ii  libdpkg-perl    1.20.10
ii  procps          2:3.3.17-5
ii  python3         3.9.2-3
ii  python3-debian  0.1.39

Versions of packages autopkgtest recommends:
ii  autodep8  0.24

Versions of packages autopkgtest suggests:
pn  lxc               <none>
pn  lxd               <none>
pn  ovmf              <none>
pn  qemu-efi-aarch64  <none>
pn  qemu-efi-arm      <none>
ii  qemu-system       1:5.2+dfsg-11+deb11u2
ii  qemu-utils        1:5.2+dfsg-11+deb11u2
ii  schroot           1.6.10-12
ii  vmdb2             0.22-1

- -- no debconf information
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEIYZ1DR4ae5UL01q7ldFmTdL1kUIFAmK0i+AACgkQldFmTdL1
kUIZfw//TMVspQMOydTGUABAWqckZ0X6TQK949KQzy9BBPQ1Sxlr1XMXGpIRqlcU
QmYD1/or5/tKW/i+kf0AEDJ4yS+862hW5iIx9LckjELNYNmbCUntb77f8WlGUFhf
Wrd47ADpqBb/zDRhLVy5K/UULRwJv/LGFN15Ofj9bZsYUAlLtu7U9mpKPyrp9pxZ
dtHyf9dD3XEYV8rGYjyu/C1ywC3h8wT03QtrppCJNOTQbq+rMXd4mAJxBy+mW2lZ
eqqKExn+0bVfmL1FOzdguz+Qr2uJSRCwXGuIFxHkRTN5Vr9oDDYe+ogzy9BHQLCg
WyU+8ukHoe1HtI0J43vCH/zVabOUs8ESigLF+klVECVO6b2YuFF7RKhuyR+t0rpR
dQhTm4NpJ2kPU108dVrROmPevmf7/pQ341fMoc0wf32W1Qrzp2WvEBETIMVqrkeU
Tw5sGH+q3qG3977j3QGUg1NeccjE6CeOYkYUlvR1S1gV8ZIsiuilOuvhGlO2v8gT
DNqPYI98OKCLKuR7E3IJcAMaDyDIBIoSx1sKPpxigjDMo3RYXZUEOoAdEA/TgWVZ
ReXaMWFJawDTYNjUDk6lJTIo+RDcDJnINYP3kfgMs3+HXLGNo1ndVumxJ2ujBGK5
z0wIfI9qkUJvzeT/KD9s1LZZhbleSbFEe3JpaaPhhRKBNXV6hag=
=Bgy9
-----END PGP SIGNATURE-----

#1013436#10
Date:
2023-09-17 14:32:29 UTC
From:
To:
"Roberto C. Sanchez" <roberto@debian.org> writes:

This is still happening with 5.30.

#1013436#15
Date:
2023-09-17 14:32:29 UTC
From:
To:
"Roberto C. Sanchez" <roberto@debian.org> writes:

This is still happening with 5.30.

#1013436#20
Date:
2023-09-17 14:50:08 UTC
From:
To:
David Bremner <david@tethera.net> writes:

FWIW, my command line was

sudo autopkgtest-build-qemu sid autopkgtest-sid-i386 https://deb.debian.org/debian i386

#1013436#25
Date:
2023-09-17 14:50:08 UTC
From:
To:
David Bremner <david@tethera.net> writes:

FWIW, my command line was

sudo autopkgtest-build-qemu sid autopkgtest-sid-i386 https://deb.debian.org/debian i386

#1013436#30
Date:
2025-09-18 16:02:20 UTC
From:
To:
Hi,

Building i386 sid images is currently not expected to work: there is no
i386 kernel anymore.

Earlier comments to this bug are rather old, and many things changed
since then. Can affected people please share a (non-)working command
line, and the autopkgtest version in use?

Thanks!

#1013436#37
Date:
2026-03-05 14:02:39 UTC
From:
To:
Explicitly CC'ing involved people.

I'm also assuming this is more of an src:vmdb2 issue. I just notice
https://bugs.debian.org/1052123 which seems related to the error message.

Paul

#1013436#42
Date:
2026-03-05 14:57:41 UTC
From:
To:
Thanks for the ping. I somehow missed the request from last year asking
for more info.

#1013436#47
Date:
2026-03-05 15:22:10 UTC
From:
To:
Hi Paride,
For my part, I am not trying to build i386 images. I'm trying to build
same-arch (amd64) images.

I first tried on a bookworm system with these versions:

ii  autopkgtest                                   5.28                                 all          automatic as-installed testing for Debian packages
ii  vmdb2                                         0.27+really.0.26-1+deb12u1           all          creator of disk images with Debian installed

Then on a trixie system with these versions:

ii  autopkgtest                                   5.49                                 all          automatic as-installed testing for Debian packages
ii  vmdb2                                         0.40-2                               all          creator of disk images with Debian installed

My first attempts failed. However, with the newer versions of these
packages (and perhaps the dependencies), I was able to see that the
exit status 100 was being caused by this:

mktemp: failed to create file via template ‘/tmp/user/0/tmp.XXXXXXXXXX’: No such file or directory

I use pam_tmpdir on my systems, and this was apparently causing the
problem.

I changed my command from this:

sudo autopkgtest-build-qemu bookworm ./autopkgtest-bookworm.img

to this:

sudo sh -c 'TMP=/tmp TMPDIR=/tmp autopkgtest-build-qemu bookworm ./autopkgtest-bookworm.img'

And now everything works. So, it appears that this was the root cause,
at least in my case.

Regards,

#1013436#52
Date:
2026-03-05 19:36:25 UTC
From:
To:
Control: retitle -1 autopkgtest-build-qemu: fails with non-default TMPDIR

Ah, that makes sense. It looks like the problem here is with environment
variables from your (root) shell being inherited by the processes that
run inside the system-under-construction: *some* environment variables
from the host make sense to propagate like this, but the TMPDIR from the
host system isn't applicable in the system-under-construction (it exists
on the host system, but does not exist in the
system-under-construction), causing this failure.

Another way to express this would be to say that the problem is with
vmdb2 chroot'ing into the system-under-construction, as opposed to
behaving like a container manager and isolating the
system-under-construction from the host more thoroughly (starting with
`env -i`, and then adding back in only an allowlist of environment
variables).

In autopkgtest-build-docker (aka a-b-podman), which does isolate the
container from the host more thoroughly, there's a list of environment
variables that are explicitly copied from host to container
(SETUP_TESTBED_ARGS). Probably autopkgtest-build-qemu and/or vmdb2
should ideally do something similar.

Unsetting TMPDIR and maybe TMP would likely be a workaround for this
specific issue, although it would presumably still be possible to break
a-b-qemu with different environment variables that similarly refer to a
path that only exists on your host system and therefore don't make much
sense to copy across the chroot/container boundary.

Is

     sudo env -u TMPDIR autopkgtest-build-qemu bookworm ./autopkgtest-bookworm.img

sufficient? (I think it probably is)

     smcv

#1013436#59
Date:
2026-03-05 19:50:55 UTC
From:
To:
Yes, that works just as well.

Regards,