libguestfs / guestfs-tools

Tools for accessing and modifying guest disk images
https://libguestfs.org
GNU General Public License v2.0
14 stars 6 forks source link

`debian-11` template fails to build images #10

Closed ehuelsmann closed 9 months ago

ehuelsmann commented 1 year ago

When running virt-builder --size 20G --format qcow2 -o vm.qcow2 --arch amd64 --update debian-11 fails to build an image.

Running the same command for debian-10 (virt-builder --size 20G --format qcow2 -o vm.qcow2 --arch amd64 --update debian-10) results in:

$ virt-builder --size 20G --format qcow2 -o vm.qcow2 --arch amd64 --update debian-10
[   1.1] Downloading: http://builder.libguestfs.org/debian-10.xz
[   1.8] Planning how to build this image
[   1.8] Uncompressing
[   4.1] Resizing (using virt-resize) to expand the disk to 20.0G
[  16.0] Opening the new disk
[  18.1] Setting a random seed
virt-builder: warning: random seed could not be set for this type of guest
[  18.1] Updating packages
[  19.5] Setting passwords
virt-builder: Setting random password of root to Bo2kAD2YWiQ7YYK6
[  20.2] Finishing off
                   Output file: vm.qcow2
                   Output size: 20.0G
                 Output format: qcow2
            Total usable space: 19.6G
                    Free space: 18.6G (95%)

I'm expecting the same for debian-11 (virt-builder --size 20G --format qcow2 -o vm.qcow2 --arch amd64 --update debian-11) to produce the same result, but instead it results in:

$ virt-builder --size 20G --format qcow2 -o vm.qcow2 --arch amd64 --update debian-11
[   1.2] Downloading: http://builder.libguestfs.org/debian-11.xz
[   1.8] Planning how to build this image
[   1.8] Uncompressing
[   4.0] Resizing (using virt-resize) to expand the disk to 20.0G
[  15.4] Opening the new disk
[  17.5] Setting a random seed
virt-builder: warning: random seed could not be set for this type of guest
[  17.5] Updating packages
Get:1 http://security.debian.org/debian-security bullseye-security InRelease [48.4 kB]
Get:2 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
Get:4 http://security.debian.org/debian-security bullseye-security/main Sources [152 kB]
Get:5 http://deb.debian.org/debian bullseye/main Sources [8633 kB]
Get:6 http://security.debian.org/debian-security bullseye-security/main amd64 Packages [184 kB]
Get:7 http://security.debian.org/debian-security bullseye-security/main Translation-en [115 kB]
Get:8 http://deb.debian.org/debian bullseye-updates/main Sources.diff/Index [9483 B]
Get:9 http://deb.debian.org/debian bullseye-updates/main amd64 Packages.diff/Index [9483 B]
Get:10 http://deb.debian.org/debian bullseye-updates/main Sources T-2022-08-18-2019.35-F-2022-01-24-2024.03.pdiff [560 B]
Get:10 http://deb.debian.org/debian bullseye-updates/main Sources T-2022-08-18-2019.35-F-2022-01-24-2024.03.pdiff [560 B]
Get:11 http://deb.debian.org/debian bullseye-updates/main amd64 Packages T-2022-08-18-2019.35-F-2022-01-24-2024.03.pdiff [1299 B]
Get:11 http://deb.debian.org/debian bullseye-updates/main amd64 Packages T-2022-08-18-2019.35-F-2022-01-24-2024.03.pdiff [1299 B]
Get:12 http://deb.debian.org/debian bullseye/main amd64 Packages [8184 kB]
Get:13 http://deb.debian.org/debian bullseye/main Translation-en [6239 kB]
Fetched 23.7 MB in 3s (8015 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
The following packages have been kept back:
  linux-image-amd64
The following packages will be upgraded:
  base-files bash bind9-dnsutils bind9-host bind9-libs bsdextrautils bsdutils
  distro-info-data dpkg fdisk gpgv grub-common grub-pc grub-pc-bin
  grub2-common gzip krb5-locales libblkid1 libc-bin libc-l10n libc6
  libcryptsetup12 libcurl3-gnutls libexpat1 libfdisk1 libfreetype6 libgmp10
  libgnutls30 libgssapi-krb5-2 libk5crypto3 libkrb5-3 libkrb5support0
  libldap-2.4-2 libldap-common liblzma5 libmount1 libnss-systemd
  libpam-systemd libpcre2-8-0 libsasl2-2 libsasl2-modules libsasl2-modules-db
  libseccomp2 libsmartcols1 libssl1.1 libsystemd0 libtirpc-common libtirpc3
  libudev1 libuuid1 libxml2 locales logrotate mount nano openssh-client
  openssh-server openssh-sftp-server openssl publicsuffix qemu-guest-agent
  rsyslog systemd systemd-sysv systemd-timesyncd sysvinit-utils task-english
  task-ssh-server tasksel tasksel-data tzdata udev util-linux
  util-linux-locales vim-common vim-tiny wget xxd xz-utils zlib1g
80 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 45.3 MB of archives.
After this operation, 779 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main amd64 base-files amd64 11.1+deb11u5 [70.1 kB]
Get:2 http://deb.debian.org/debian bullseye/main amd64 bash amd64 5.1-2+deb11u1 [1417 kB]
Get:3 http://deb.debian.org/debian bullseye/main amd64 bsdutils amd64 1:2.36.1-8+deb11u1 [148 kB]
Get:4 http://deb.debian.org/debian bullseye/main amd64 dpkg amd64 1.20.12 [2536 kB]
Get:5 http://deb.debian.org/debian bullseye/main amd64 gzip amd64 1.10-4+deb11u1 [132 kB]
Get:6 http://deb.debian.org/debian bullseye/main amd64 libc6 amd64 2.31-13+deb11u4 [2824 kB]
Get:7 http://deb.debian.org/debian bullseye/main amd64 libblkid1 amd64 2.36.1-8+deb11u1 [193 kB]
Get:8 http://deb.debian.org/debian bullseye/main amd64 libuuid1 amd64 2.36.1-8+deb11u1 [83.9 kB]
Get:9 http://deb.debian.org/debian bullseye/main amd64 libfdisk1 amd64 2.36.1-8+deb11u1 [237 kB]
Get:10 http://deb.debian.org/debian bullseye/main amd64 libmount1 amd64 2.36.1-8+deb11u1 [212 kB]
Get:11 http://deb.debian.org/debian bullseye/main amd64 libsmartcols1 amd64 2.36.1-8+deb11u1 [158 kB]
Get:12 http://deb.debian.org/debian bullseye/main amd64 fdisk amd64 2.36.1-8+deb11u1 [192 kB]
Get:13 http://deb.debian.org/debian bullseye/main amd64 util-linux amd64 2.36.1-8+deb11u1 [1141 kB]
Get:14 http://deb.debian.org/debian bullseye/main amd64 libc-bin amd64 2.31-13+deb11u4 [829 kB]
Get:15 http://deb.debian.org/debian bullseye/main amd64 sysvinit-utils amd64 2.96-7+deb11u1 [25.6 kB]
Get:16 http://deb.debian.org/debian bullseye/main amd64 libnss-systemd amd64 247.3-7+deb11u1 [199 kB]
Get:17 http://deb.debian.org/debian bullseye/main amd64 libsystemd0 amd64 247.3-7+deb11u1 [376 kB]
Get:18 http://deb.debian.org/debian bullseye/main amd64 systemd-timesyncd amd64 247.3-7+deb11u1 [131 kB]
Get:19 http://deb.debian.org/debian bullseye/main amd64 libpam-systemd amd64 247.3-7+deb11u1 [283 kB]
Get:20 http://deb.debian.org/debian bullseye/main amd64 systemd amd64 247.3-7+deb11u1 [4501 kB]
Get:21 http://deb.debian.org/debian bullseye/main amd64 udev amd64 247.3-7+deb11u1 [1464 kB]
Get:22 http://deb.debian.org/debian bullseye/main amd64 libudev1 amd64 247.3-7+deb11u1 [168 kB]
Get:23 http://deb.debian.org/debian bullseye/main amd64 systemd-sysv amd64 247.3-7+deb11u1 [113 kB]
Get:24 http://deb.debian.org/debian bullseye/main amd64 libssl1.1 amd64 1.1.1n-0+deb11u3 [1559 kB]
Get:25 http://deb.debian.org/debian bullseye/main amd64 libcryptsetup12 amd64 2:2.3.7-1+deb11u1 [248 kB]
Get:26 http://deb.debian.org/debian bullseye/main amd64 libgmp10 amd64 2:6.2.1+dfsg-1+deb11u1 [563 kB]
Get:27 http://deb.debian.org/debian bullseye/main amd64 libgnutls30 amd64 3.7.1-5+deb11u2 [1341 kB]
Get:28 http://deb.debian.org/debian bullseye/main amd64 libseccomp2 amd64 2.5.1-1+deb11u1 [48.5 kB]
Get:29 http://deb.debian.org/debian bullseye/main amd64 mount amd64 2.36.1-8+deb11u1 [186 kB]
Get:30 http://deb.debian.org/debian bullseye/main amd64 zlib1g amd64 1:1.2.11.dfsg-2+deb11u2 [91.4 kB]
Get:31 http://deb.debian.org/debian bullseye/main amd64 rsyslog amd64 8.2102.0-2+deb11u1 [703 kB]
Get:32 http://deb.debian.org/debian bullseye/main amd64 bsdextrautils amd64 2.36.1-8+deb11u1 [145 kB]
Get:33 http://deb.debian.org/debian bullseye/main amd64 qemu-guest-agent amd64 1:5.2+dfsg-11+deb11u2 [273 kB]
Get:34 http://deb.debian.org/debian bullseye/main amd64 libc-l10n all 2.31-13+deb11u4 [864 kB]
Get:35 http://deb.debian.org/debian bullseye/main amd64 locales all 2.31-13+deb11u4 [4084 kB]
Get:36 http://deb.debian.org/debian bullseye/main amd64 task-english all 3.68+deb11u1 [956 B]
Get:37 http://deb.debian.org/debian bullseye/main amd64 tasksel-data all 3.68+deb11u1 [18.0 kB]
Get:38 http://deb.debian.org/debian bullseye/main amd64 libk5crypto3 amd64 1.18.3-6+deb11u2 [114 kB]
Get:39 http://deb.debian.org/debian bullseye/main amd64 libkrb5support0 amd64 1.18.3-6+deb11u2 [65.3 kB]
Get:40 http://deb.debian.org/debian bullseye/main amd64 libkrb5-3 amd64 1.18.3-6+deb11u2 [363 kB]
Get:41 http://deb.debian.org/debian bullseye/main amd64 libgssapi-krb5-2 amd64 1.18.3-6+deb11u2 [165 kB]
Get:42 http://deb.debian.org/debian bullseye/main amd64 openssh-sftp-server amd64 1:8.4p1-5+deb11u1 [52.4 kB]
Get:43 http://deb.debian.org/debian bullseye/main amd64 openssh-server amd64 1:8.4p1-5+deb11u1 [385 kB]
Get:44 http://deb.debian.org/debian bullseye/main amd64 openssh-client amd64 1:8.4p1-5+deb11u1 [929 kB]
Get:45 http://deb.debian.org/debian bullseye/main amd64 task-ssh-server all 3.68+deb11u1 [916 B]
Get:46 http://deb.debian.org/debian bullseye/main amd64 tasksel all 3.68+deb11u1 [101 kB]
Get:47 http://deb.debian.org/debian bullseye/main amd64 gpgv amd64 2.2.27-2+deb11u2 [626 kB]
Get:48 http://deb.debian.org/debian bullseye/main amd64 liblzma5 amd64 5.2.5-2.1~deb11u1 [168 kB]
Get:49 http://deb.debian.org/debian bullseye/main amd64 libpcre2-8-0 amd64 10.36-2+deb11u1 [248 kB]
Get:50 http://deb.debian.org/debian bullseye/main amd64 libtirpc-common all 1.3.1-1+deb11u1 [13.5 kB]
Get:51 http://deb.debian.org/debian bullseye/main amd64 libtirpc3 amd64 1.3.1-1+deb11u1 [84.1 kB]
Get:52 http://deb.debian.org/debian bullseye/main amd64 tzdata all 2021a-1+deb11u5 [284 kB]
Get:53 http://deb.debian.org/debian bullseye/main amd64 logrotate amd64 3.18.0-2+deb11u1 [72.7 kB]
Get:54 http://deb.debian.org/debian bullseye/main amd64 nano amd64 5.4-2+deb11u1 [656 kB]
Get:55 http://deb.debian.org/debian bullseye/main amd64 vim-tiny amd64 2:8.2.2434-3+deb11u1 [744 kB]
Get:56 http://deb.debian.org/debian bullseye/main amd64 xxd amd64 2:8.2.2434-3+deb11u1 [192 kB]
Get:57 http://deb.debian.org/debian bullseye/main amd64 vim-common all 2:8.2.2434-3+deb11u1 [226 kB]
Get:58 http://deb.debian.org/debian bullseye/main amd64 libxml2 amd64 2.9.10+dfsg-6.7+deb11u2 [692 kB]
Get:59 http://deb.debian.org/debian bullseye/main amd64 bind9-dnsutils amd64 1:9.16.27-1~deb11u1 [398 kB]
Get:60 http://deb.debian.org/debian bullseye/main amd64 bind9-libs amd64 1:9.16.27-1~deb11u1 [1413 kB]
Get:61 http://deb.debian.org/debian bullseye/main amd64 bind9-host amd64 1:9.16.27-1~deb11u1 [302 kB]
Get:62 http://deb.debian.org/debian bullseye/main amd64 krb5-locales all 1.18.3-6+deb11u2 [95.4 kB]
Get:63 http://deb.debian.org/debian bullseye/main amd64 wget amd64 1.21-1+deb11u1 [964 kB]
Get:64 http://deb.debian.org/debian bullseye/main amd64 xz-utils amd64 5.2.5-2.1~deb11u1 [220 kB]
Get:65 http://deb.debian.org/debian bullseye/main amd64 distro-info-data all 0.51+deb11u2 [7684 B]
Get:66 http://deb.debian.org/debian bullseye/main amd64 grub-pc amd64 2.06-3~deb11u1 [131 kB]
Get:67 http://deb.debian.org/debian bullseye/main amd64 grub2-common amd64 2.06-3~deb11u1 [610 kB]
Get:68 http://deb.debian.org/debian bullseye/main amd64 grub-pc-bin amd64 2.06-3~deb11u1 [992 kB]
Get:69 http://deb.debian.org/debian bullseye/main amd64 libfreetype6 amd64 2.10.4+dfsg-1+deb11u1 [418 kB]
Get:70 http://deb.debian.org/debian bullseye/main amd64 grub-common amd64 2.06-3~deb11u1 [2762 kB]
Get:71 http://deb.debian.org/debian bullseye/main amd64 libsasl2-modules-db amd64 2.1.27+dfsg-2.1+deb11u1 [69.1 kB]
Get:72 http://deb.debian.org/debian bullseye/main amd64 libsasl2-2 amd64 2.1.27+dfsg-2.1+deb11u1 [106 kB]
Get:73 http://deb.debian.org/debian bullseye/main amd64 libldap-2.4-2 amd64 2.4.57+dfsg-3+deb11u1 [232 kB]
Get:74 http://deb.debian.org/debian bullseye/main amd64 libcurl3-gnutls amd64 7.74.0-1.3+deb11u3 [342 kB]
Get:75 http://deb.debian.org/debian bullseye/main amd64 libexpat1 amd64 2.2.10-2+deb11u3 [98.5 kB]
Get:76 http://deb.debian.org/debian bullseye/main amd64 libldap-common all 2.4.57+dfsg-3+deb11u1 [95.8 kB]
Get:77 http://deb.debian.org/debian bullseye/main amd64 libsasl2-modules amd64 2.1.27+dfsg-2.1+deb11u1 [104 kB]
Get:78 http://deb.debian.org/debian bullseye/main amd64 openssl amd64 1.1.1n-0+deb11u3 [853 kB]
Get:79 http://deb.debian.org/debian bullseye/main amd64 publicsuffix all 20220811.1734-0+deb11u1 [127 kB]
Get:80 http://deb.debian.org/debian bullseye/main amd64 util-linux-locales all 2.36.1-8+deb11u1 [1192 kB]
apt-listchanges: Reading changelogs...
Preconfiguring packages ...
Fetched 45.3 MB in 4s (11.7 MB/s)
(Reading database ... 27881 files and directories currently installed.)
Preparing to unpack .../base-files_11.1+deb11u5_amd64.deb ...
Unpacking base-files (11.1+deb11u5) over (11.1+deb11u1) ...
Setting up base-files (11.1+deb11u5) ...
Installing new version of config file /etc/debian_version ...
(Reading database ... 27881 files and directories currently installed.)
Preparing to unpack .../bash_5.1-2+deb11u1_amd64.deb ...
Unpacking bash (5.1-2+deb11u1) over (5.1-2+b3) ...
Setting up bash (5.1-2+deb11u1) ...
update-alternatives: using /usr/share/man/man7/bash-builtins.7.gz to provide /usr/share/man/man7/builtins.7.gz (builtins.7.gz) in auto mode
(Reading database ... 27880 files and directories currently installed.)
Preparing to unpack .../bsdutils_1%3a2.36.1-8+deb11u1_amd64.deb ...
Unpacking bsdutils (1:2.36.1-8+deb11u1) over (1:2.36.1-8) ...
Setting up bsdutils (1:2.36.1-8+deb11u1) ...
(Reading database ... 27880 files and directories currently installed.)
Preparing to unpack .../dpkg_1.20.12_amd64.deb ...
Unpacking dpkg (1.20.12) over (1.20.9) ...
Setting up dpkg (1.20.12) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../gzip_1.10-4+deb11u1_amd64.deb ...
Unpacking gzip (1.10-4+deb11u1) over (1.10-4) ...
Setting up gzip (1.10-4+deb11u1) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../libc6_2.31-13+deb11u4_amd64.deb ...
Unpacking libc6:amd64 (2.31-13+deb11u4) over (2.31-13+deb11u2) ...
Setting up libc6:amd64 (2.31-13+deb11u4) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../libblkid1_2.36.1-8+deb11u1_amd64.deb ...
Unpacking libblkid1:amd64 (2.36.1-8+deb11u1) over (2.36.1-8) ...
Setting up libblkid1:amd64 (2.36.1-8+deb11u1) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../libuuid1_2.36.1-8+deb11u1_amd64.deb ...
Unpacking libuuid1:amd64 (2.36.1-8+deb11u1) over (2.36.1-8) ...
Setting up libuuid1:amd64 (2.36.1-8+deb11u1) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../libfdisk1_2.36.1-8+deb11u1_amd64.deb ...
Unpacking libfdisk1:amd64 (2.36.1-8+deb11u1) over (2.36.1-8) ...
Preparing to unpack .../libmount1_2.36.1-8+deb11u1_amd64.deb ...
Unpacking libmount1:amd64 (2.36.1-8+deb11u1) over (2.36.1-8) ...
Setting up libmount1:amd64 (2.36.1-8+deb11u1) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../libsmartcols1_2.36.1-8+deb11u1_amd64.deb ...
Unpacking libsmartcols1:amd64 (2.36.1-8+deb11u1) over (2.36.1-8) ...
Setting up libsmartcols1:amd64 (2.36.1-8+deb11u1) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../fdisk_2.36.1-8+deb11u1_amd64.deb ...
Unpacking fdisk (2.36.1-8+deb11u1) over (2.36.1-8) ...
Preparing to unpack .../util-linux_2.36.1-8+deb11u1_amd64.deb ...
Unpacking util-linux (2.36.1-8+deb11u1) over (2.36.1-8) ...
Setting up util-linux (2.36.1-8+deb11u1) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../libc-bin_2.31-13+deb11u4_amd64.deb ...
Unpacking libc-bin (2.31-13+deb11u4) over (2.31-13+deb11u2) ...
Setting up libc-bin (2.31-13+deb11u4) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../sysvinit-utils_2.96-7+deb11u1_amd64.deb ...
Unpacking sysvinit-utils (2.96-7+deb11u1) over (2.96-7) ...
Setting up sysvinit-utils (2.96-7+deb11u1) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../libnss-systemd_247.3-7+deb11u1_amd64.deb ...
Unpacking libnss-systemd:amd64 (247.3-7+deb11u1) over (247.3-6) ...
Preparing to unpack .../libsystemd0_247.3-7+deb11u1_amd64.deb ...
Unpacking libsystemd0:amd64 (247.3-7+deb11u1) over (247.3-6) ...
Setting up libsystemd0:amd64 (247.3-7+deb11u1) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../systemd-timesyncd_247.3-7+deb11u1_amd64.deb ...
Unpacking systemd-timesyncd (247.3-7+deb11u1) over (247.3-6) ...
Preparing to unpack .../libpam-systemd_247.3-7+deb11u1_amd64.deb ...
Unpacking libpam-systemd:amd64 (247.3-7+deb11u1) over (247.3-6) ...
Preparing to unpack .../systemd_247.3-7+deb11u1_amd64.deb ...
Unpacking systemd (247.3-7+deb11u1) over (247.3-6) ...
Preparing to unpack .../udev_247.3-7+deb11u1_amd64.deb ...
Unpacking udev (247.3-7+deb11u1) over (247.3-6) ...
Preparing to unpack .../libudev1_247.3-7+deb11u1_amd64.deb ...
Unpacking libudev1:amd64 (247.3-7+deb11u1) over (247.3-6) ...
Setting up libudev1:amd64 (247.3-7+deb11u1) ...
Setting up systemd (247.3-7+deb11u1) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../systemd-sysv_247.3-7+deb11u1_amd64.deb ...
Unpacking systemd-sysv (247.3-7+deb11u1) over (247.3-6) ...
Preparing to unpack .../libssl1.1_1.1.1n-0+deb11u3_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.1n-0+deb11u3) over (1.1.1k-1+deb11u1) ...
Setting up libssl1.1:amd64 (1.1.1n-0+deb11u3) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../libcryptsetup12_2%3a2.3.7-1+deb11u1_amd64.deb ...
Unpacking libcryptsetup12:amd64 (2:2.3.7-1+deb11u1) over (2:2.3.5-1) ...
Preparing to unpack .../libgmp10_2%3a6.2.1+dfsg-1+deb11u1_amd64.deb ...
Unpacking libgmp10:amd64 (2:6.2.1+dfsg-1+deb11u1) over (2:6.2.1+dfsg-1) ...
Setting up libgmp10:amd64 (2:6.2.1+dfsg-1+deb11u1) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../libgnutls30_3.7.1-5+deb11u2_amd64.deb ...
Unpacking libgnutls30:amd64 (3.7.1-5+deb11u2) over (3.7.1-5) ...
Setting up libgnutls30:amd64 (3.7.1-5+deb11u2) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../libseccomp2_2.5.1-1+deb11u1_amd64.deb ...
Unpacking libseccomp2:amd64 (2.5.1-1+deb11u1) over (2.5.1-1) ...
Setting up libseccomp2:amd64 (2.5.1-1+deb11u1) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../mount_2.36.1-8+deb11u1_amd64.deb ...
Unpacking mount (2.36.1-8+deb11u1) over (2.36.1-8) ...
Preparing to unpack .../zlib1g_1%3a1.2.11.dfsg-2+deb11u2_amd64.deb ...
Unpacking zlib1g:amd64 (1:1.2.11.dfsg-2+deb11u2) over (1:1.2.11.dfsg-2) ...
Setting up zlib1g:amd64 (1:1.2.11.dfsg-2+deb11u2) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../0-rsyslog_8.2102.0-2+deb11u1_amd64.deb ...
Unpacking rsyslog (8.2102.0-2+deb11u1) over (8.2102.0-2) ...
Preparing to unpack .../1-bsdextrautils_2.36.1-8+deb11u1_amd64.deb ...
Unpacking bsdextrautils (2.36.1-8+deb11u1) over (2.36.1-8) ...
Preparing to unpack .../2-qemu-guest-agent_1%3a5.2+dfsg-11+deb11u2_amd64.deb ...
Unpacking qemu-guest-agent (1:5.2+dfsg-11+deb11u2) over (1:5.2+dfsg-11+deb11u1) ...
Preparing to unpack .../3-libc-l10n_2.31-13+deb11u4_all.deb ...
Unpacking libc-l10n (2.31-13+deb11u4) over (2.31-13+deb11u2) ...
Preparing to unpack .../4-locales_2.31-13+deb11u4_all.deb ...
Unpacking locales (2.31-13+deb11u4) over (2.31-13+deb11u2) ...
Preparing to unpack .../5-task-english_3.68+deb11u1_all.deb ...
Unpacking task-english (3.68+deb11u1) over (3.68) ...
Preparing to unpack .../6-tasksel-data_3.68+deb11u1_all.deb ...
Unpacking tasksel-data (3.68+deb11u1) over (3.68) ...
Preparing to unpack .../7-libk5crypto3_1.18.3-6+deb11u2_amd64.deb ...
Unpacking libk5crypto3:amd64 (1.18.3-6+deb11u2) over (1.18.3-6+deb11u1) ...
Setting up libk5crypto3:amd64 (1.18.3-6+deb11u2) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../libkrb5support0_1.18.3-6+deb11u2_amd64.deb ...
Unpacking libkrb5support0:amd64 (1.18.3-6+deb11u2) over (1.18.3-6+deb11u1) ...
Setting up libkrb5support0:amd64 (1.18.3-6+deb11u2) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../libkrb5-3_1.18.3-6+deb11u2_amd64.deb ...
Unpacking libkrb5-3:amd64 (1.18.3-6+deb11u2) over (1.18.3-6+deb11u1) ...
Setting up libkrb5-3:amd64 (1.18.3-6+deb11u2) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../libgssapi-krb5-2_1.18.3-6+deb11u2_amd64.deb ...
Unpacking libgssapi-krb5-2:amd64 (1.18.3-6+deb11u2) over (1.18.3-6+deb11u1) ...
Setting up libgssapi-krb5-2:amd64 (1.18.3-6+deb11u2) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../0-openssh-sftp-server_1%3a8.4p1-5+deb11u1_amd64.deb ...
Unpacking openssh-sftp-server (1:8.4p1-5+deb11u1) over (1:8.4p1-5) ...
Preparing to unpack .../1-openssh-server_1%3a8.4p1-5+deb11u1_amd64.deb ...
Unpacking openssh-server (1:8.4p1-5+deb11u1) over (1:8.4p1-5) ...
Preparing to unpack .../2-openssh-client_1%3a8.4p1-5+deb11u1_amd64.deb ...
Unpacking openssh-client (1:8.4p1-5+deb11u1) over (1:8.4p1-5) ...
Preparing to unpack .../3-task-ssh-server_3.68+deb11u1_all.deb ...
Unpacking task-ssh-server (3.68+deb11u1) over (3.68) ...
Preparing to unpack .../4-tasksel_3.68+deb11u1_all.deb ...
Unpacking tasksel (3.68+deb11u1) over (3.68) ...
Preparing to unpack .../5-gpgv_2.2.27-2+deb11u2_amd64.deb ...
Unpacking gpgv (2.2.27-2+deb11u2) over (2.2.27-2) ...
Setting up gpgv (2.2.27-2+deb11u2) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../liblzma5_5.2.5-2.1~deb11u1_amd64.deb ...
Unpacking liblzma5:amd64 (5.2.5-2.1~deb11u1) over (5.2.5-2) ...
Setting up liblzma5:amd64 (5.2.5-2.1~deb11u1) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../libpcre2-8-0_10.36-2+deb11u1_amd64.deb ...
Unpacking libpcre2-8-0:amd64 (10.36-2+deb11u1) over (10.36-2) ...
Setting up libpcre2-8-0:amd64 (10.36-2+deb11u1) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../libtirpc-common_1.3.1-1+deb11u1_all.deb ...
Unpacking libtirpc-common (1.3.1-1+deb11u1) over (1.3.1-1) ...
Setting up libtirpc-common (1.3.1-1+deb11u1) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../libtirpc3_1.3.1-1+deb11u1_amd64.deb ...
Unpacking libtirpc3:amd64 (1.3.1-1+deb11u1) over (1.3.1-1) ...
Setting up libtirpc3:amd64 (1.3.1-1+deb11u1) ...
(Reading database ... 27889 files and directories currently installed.)
Preparing to unpack .../00-tzdata_2021a-1+deb11u5_all.deb ...
Unpacking tzdata (2021a-1+deb11u5) over (2021a-1+deb11u2) ...
Preparing to unpack .../01-logrotate_3.18.0-2+deb11u1_amd64.deb ...
Unpacking logrotate (3.18.0-2+deb11u1) over (3.18.0-2) ...
Preparing to unpack .../02-nano_5.4-2+deb11u1_amd64.deb ...
Unpacking nano (5.4-2+deb11u1) over (5.4-2) ...
Preparing to unpack .../03-vim-tiny_2%3a8.2.2434-3+deb11u1_amd64.deb ...
Unpacking vim-tiny (2:8.2.2434-3+deb11u1) over (2:8.2.2434-3) ...
Preparing to unpack .../04-xxd_2%3a8.2.2434-3+deb11u1_amd64.deb ...
Unpacking xxd (2:8.2.2434-3+deb11u1) over (2:8.2.2434-3) ...
Preparing to unpack .../05-vim-common_2%3a8.2.2434-3+deb11u1_all.deb ...
Unpacking vim-common (2:8.2.2434-3+deb11u1) over (2:8.2.2434-3) ...
Preparing to unpack .../06-libxml2_2.9.10+dfsg-6.7+deb11u2_amd64.deb ...
Unpacking libxml2:amd64 (2.9.10+dfsg-6.7+deb11u2) over (2.9.10+dfsg-6.7) ...
Preparing to unpack .../07-bind9-dnsutils_1%3a9.16.27-1~deb11u1_amd64.deb ...
Unpacking bind9-dnsutils (1:9.16.27-1~deb11u1) over (1:9.16.15-1) ...
Preparing to unpack .../08-bind9-libs_1%3a9.16.27-1~deb11u1_amd64.deb ...
Unpacking bind9-libs:amd64 (1:9.16.27-1~deb11u1) over (1:9.16.15-1) ...
Preparing to unpack .../09-bind9-host_1%3a9.16.27-1~deb11u1_amd64.deb ...
Unpacking bind9-host (1:9.16.27-1~deb11u1) over (1:9.16.15-1) ...
Preparing to unpack .../10-krb5-locales_1.18.3-6+deb11u2_all.deb ...
Unpacking krb5-locales (1.18.3-6+deb11u2) over (1.18.3-6+deb11u1) ...
Preparing to unpack .../11-wget_1.21-1+deb11u1_amd64.deb ...
Unpacking wget (1.21-1+deb11u1) over (1.21-1+b1) ...
Preparing to unpack .../12-xz-utils_5.2.5-2.1~deb11u1_amd64.deb ...
Unpacking xz-utils (5.2.5-2.1~deb11u1) over (5.2.5-2) ...
Preparing to unpack .../13-distro-info-data_0.51+deb11u2_all.deb ...
Unpacking distro-info-data (0.51+deb11u2) over (0.51) ...
Preparing to unpack .../14-grub-pc_2.06-3~deb11u1_amd64.deb ...
Unpacking grub-pc (2.06-3~deb11u1) over (2.04-20) ...
Preparing to unpack .../15-grub2-common_2.06-3~deb11u1_amd64.deb ...
Unpacking grub2-common (2.06-3~deb11u1) over (2.04-20) ...
Preparing to unpack .../16-grub-pc-bin_2.06-3~deb11u1_amd64.deb ...
Unpacking grub-pc-bin (2.06-3~deb11u1) over (2.04-20) ...
Preparing to unpack .../17-libfreetype6_2.10.4+dfsg-1+deb11u1_amd64.deb ...
Unpacking libfreetype6:amd64 (2.10.4+dfsg-1+deb11u1) over (2.10.4+dfsg-1) ...
Preparing to unpack .../18-grub-common_2.06-3~deb11u1_amd64.deb ...
Unpacking grub-common (2.06-3~deb11u1) over (2.04-20) ...
Preparing to unpack .../19-libsasl2-modules-db_2.1.27+dfsg-2.1+deb11u1_amd64.deb ...
Unpacking libsasl2-modules-db:amd64 (2.1.27+dfsg-2.1+deb11u1) over (2.1.27+dfsg-2.1) ...
Preparing to unpack .../20-libsasl2-2_2.1.27+dfsg-2.1+deb11u1_amd64.deb ...
Unpacking libsasl2-2:amd64 (2.1.27+dfsg-2.1+deb11u1) over (2.1.27+dfsg-2.1) ...
Preparing to unpack .../21-libldap-2.4-2_2.4.57+dfsg-3+deb11u1_amd64.deb ...
Unpacking libldap-2.4-2:amd64 (2.4.57+dfsg-3+deb11u1) over (2.4.57+dfsg-3) ...
Preparing to unpack .../22-libcurl3-gnutls_7.74.0-1.3+deb11u3_amd64.deb ...
Unpacking libcurl3-gnutls:amd64 (7.74.0-1.3+deb11u3) over (7.74.0-1.3+b1) ...
Preparing to unpack .../23-libexpat1_2.2.10-2+deb11u3_amd64.deb ...
Unpacking libexpat1:amd64 (2.2.10-2+deb11u3) over (2.2.10-2) ...
Preparing to unpack .../24-libldap-common_2.4.57+dfsg-3+deb11u1_all.deb ...
Unpacking libldap-common (2.4.57+dfsg-3+deb11u1) over (2.4.57+dfsg-3) ...
Preparing to unpack .../25-libsasl2-modules_2.1.27+dfsg-2.1+deb11u1_amd64.deb ...
Unpacking libsasl2-modules:amd64 (2.1.27+dfsg-2.1+deb11u1) over (2.1.27+dfsg-2.1) ...
Preparing to unpack .../26-openssl_1.1.1n-0+deb11u3_amd64.deb ...
Unpacking openssl (1.1.1n-0+deb11u3) over (1.1.1k-1+deb11u1) ...
Preparing to unpack .../27-publicsuffix_20220811.1734-0+deb11u1_all.deb ...
Unpacking publicsuffix (20220811.1734-0+deb11u1) over (20210108.1309-1) ...
Preparing to unpack .../28-util-linux-locales_2.36.1-8+deb11u1_all.deb ...
Unpacking util-linux-locales (2.36.1-8+deb11u1) over (2.36.1-8) ...
Setting up logrotate (3.18.0-2+deb11u1) ...
Setting up libexpat1:amd64 (2.2.10-2+deb11u3) ...
Setting up systemd-sysv (247.3-7+deb11u1) ...
Setting up libc-l10n (2.31-13+deb11u4) ...
Setting up bsdextrautils (2.36.1-8+deb11u1) ...
Setting up wget (1.21-1+deb11u1) ...
Setting up distro-info-data (0.51+deb11u2) ...
Setting up openssh-client (1:8.4p1-5+deb11u1) ...
Setting up libsasl2-modules:amd64 (2.1.27+dfsg-2.1+deb11u1) ...
Setting up qemu-guest-agent (1:5.2+dfsg-11+deb11u2) ...
Running in chroot, ignoring request.
Setting up rsyslog (8.2102.0-2+deb11u1) ...
Running in chroot, ignoring request.
Setting up libnss-systemd:amd64 (247.3-7+deb11u1) ...
Setting up krb5-locales (1.18.3-6+deb11u2) ...
Setting up locales (2.31-13+deb11u4) ...
Generating locales (this might take a while)...
  en_US.UTF-8... done
Generation complete.
Setting up libldap-common (2.4.57+dfsg-3+deb11u1) ...
Setting up xxd (2:8.2.2434-3+deb11u1) ...
Setting up libsasl2-modules-db:amd64 (2.1.27+dfsg-2.1+deb11u1) ...
Setting up tzdata (2021a-1+deb11u5) ...

Current default time zone: 'America/New_York'
Local time is now:      Tue Sep 20 14:24:16 EDT 2022.
Universal Time is now:  Tue Sep 20 18:24:16 UTC 2022.
Run 'dpkg-reconfigure tzdata' if you wish to change it.

Setting up vim-common (2:8.2.2434-3+deb11u1) ...
Setting up libfreetype6:amd64 (2.10.4+dfsg-1+deb11u1) ...
Setting up xz-utils (5.2.5-2.1~deb11u1) ...
Setting up systemd-timesyncd (247.3-7+deb11u1) ...
Setting up udev (247.3-7+deb11u1) ...
A chroot environment has been detected, udev not started.
Setting up libsasl2-2:amd64 (2.1.27+dfsg-2.1+deb11u1) ...
Setting up libfdisk1:amd64 (2.36.1-8+deb11u1) ...
Setting up nano (5.4-2+deb11u1) ...
Setting up mount (2.36.1-8+deb11u1) ...
Setting up libpam-systemd:amd64 (247.3-7+deb11u1) ...
Setting up libcryptsetup12:amd64 (2:2.3.7-1+deb11u1) ...
Setting up util-linux-locales (2.36.1-8+deb11u1) ...
Setting up openssl (1.1.1n-0+deb11u3) ...
Setting up publicsuffix (20220811.1734-0+deb11u1) ...
Setting up libxml2:amd64 (2.9.10+dfsg-6.7+deb11u2) ...
Setting up openssh-sftp-server (1:8.4p1-5+deb11u1) ...
Setting up openssh-server (1:8.4p1-5+deb11u1) ...
Creating SSH2 RSA key; this may take some time ...
3072 SHA256:yd4TyP2dv45jm8jhtEpV2ro0d8wV44gAuci/59nyJ0A root@(none) (RSA)
Creating SSH2 ECDSA key; this may take some time ...
256 SHA256:gzcWSzx80aQ+q0SC+IrAzCM+spGuUrGaP8Z3paBdg+g root@(none) (ECDSA)
Creating SSH2 ED25519 key; this may take some time ...
256 SHA256:HNEvaJy888BVTo9G59LR8vx/zo4P72j/j6kaq62NSWg root@(none) (ED25519)
Running in chroot, ignoring request.
Setting up bind9-libs:amd64 (1:9.16.27-1~deb11u1) ...
Setting up libldap-2.4-2:amd64 (2.4.57+dfsg-3+deb11u1) ...
Setting up libcurl3-gnutls:amd64 (7.74.0-1.3+deb11u3) ...
Setting up vim-tiny (2:8.2.2434-3+deb11u1) ...
Setting up fdisk (2.36.1-8+deb11u1) ...
Setting up grub-common (2.06-3~deb11u1) ...
Installing new version of config file /etc/grub.d/10_linux ...
Installing new version of config file /etc/grub.d/20_linux_xen ...
Installing new version of config file /etc/grub.d/30_os-prober ...
Installing new version of config file /etc/grub.d/30_uefi-firmware ...
Installing new version of config file /etc/grub.d/41_custom ...
Setting up bind9-host (1:9.16.27-1~deb11u1) ...
Setting up grub2-common (2.06-3~deb11u1) ...
Installing new version of config file /etc/kernel/postinst.d/zz-update-grub ...
Installing new version of config file /etc/kernel/postrm.d/zz-update-grub ...
Setting up grub-pc-bin (2.06-3~deb11u1) ...
Setting up grub-pc (2.06-3~deb11u1) ...
/dev/vda does not exist, so cannot grub-install to it!
You must correct your GRUB install devices before proceeding:

  DEBIAN_FRONTEND=dialog dpkg --configure grub-pc
  dpkg --configure -a
dpkg: error processing package grub-pc (--configure):
 installed grub-pc package post-installation script subprocess returned error exit status 1
Setting up bind9-dnsutils (1:9.16.27-1~deb11u1) ...
Setting up tasksel (3.68+deb11u1) ...
Setting up task-ssh-server (3.68+deb11u1) ...
Setting up tasksel-data (3.68+deb11u1) ...
Setting up task-english (3.68+deb11u1) ...
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for dbus (1.12.20-2) ...
Processing triggers for mailcap (3.69) ...
Processing triggers for initramfs-tools (0.140) ...
update-initramfs: Generating /boot/initrd.img-5.10.0-9-amd64
Processing triggers for libc-bin (2.31-13+deb11u4) ...
Errors were encountered while processing:
 grub-pc
E: Sub-process /usr/bin/dpkg returned an error code (1)
virt-builder: error: 
        export DEBIAN_FRONTEND=noninteractive
        apt_opts='-q -y -o Dpkg::Options::=--force-confnew'
        apt-get $apt_opts update
        apt-get $apt_opts upgrade
      : command exited with an error

If reporting bugs, run virt-builder with debugging enabled and include the 
complete output:

  virt-builder -v -x [...]

Please find the build log from $ virt-builder -v -x --size 20G --format qcow2 -o vm.qcow2 --arch amd64 --update debian-11 1>build.log 2>&1 attached:

build.log

rwmjones commented 1 year ago

The error is:

Errors were encountered while processing:
 grub-pc

which comes from the --update option which runs a bunch of apt commands.

I guess they fail because grub is trying to install a bootloader in the virt-builder appliance environment which probably doesn't have the same drives / layout as the real VM.

An alternative is to do the update later, eg:

virt-builder ... --firstboot-command 'apt-get -y update'

Or you could exclude grub-pc from the update, which would be some variation of:

virt-builder ... --run-command 'apt-mark hold grub-pc' --update
ehuelsmann commented 1 year ago

I guess they fail because grub is trying to install a bootloader in the virt-builder appliance environment which probably doesn't have the same drives / layout as the real VM.

That's correct. The virt-builder environment uses an sda device while the template image builder uses the vda device. Aligning between the two would solve this issue; I'd propose to change the build parameters for the template to install on a scsi device while creating the template image instead of on a virtio-blk device, since the former is the default for virt-builder.

rwmjones commented 1 year ago

I don't think this will solve the whole issue. There are many ways that the virt-builder environment is different from a VM. eg. BIOS drive names and geometry will be different (which matters for BIOS bootloaders). The real solution here is to not run grub from virt-builder.

ehuelsmann commented 1 year ago

Hmm. Marking grub-pc on hold won't quite work either: many things can cause the initramfs-s to be regenerated, at which point grub is being updated too which means it will go look for its installation drive. Running the upgrade on first boot only works when the layout of the VM agrees with the template builder, because if not, the upgrade will get stuck on the required user-interaction (to select the new installation device) as well.

Seems that at least the "out-of-the-box" experience can be improved by aligning between the build system and virt-builder's defaults. The user can't really change those. When firing up an image with a virtio-blk device, they can adjust the setup to use scsi instead through libvirt, if/when required to successfully boot.

rwmjones commented 1 year ago

Did you actually try it? Rebuilding the initramfs should not invoke grub, and indeed we rebuild the initramfs in virt-v2v under similar circumstances and it works fine.