Failure to build a arm64 chroot on amd64 on bionic

Bug #2048894 reported by Paul Mars
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
debootstrap (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

On bionic amd64, running debootstrap to build an arm64 chroot fails.

$ sudo debootstrap --verbose --arch=arm64 --variant=minbase --components=main,restricted,universe,multiverse bionic /tmp/chroot http://ports.ubuntu.com/ubuntu-ports/

I: Retrieving InRelease
[..]
W: Failure trying to run: chroot /tmp/chroot dpkg-deb -f /var/cache/apt/archives/dpkg_1.19.0.5ubuntu2_arm64.deb Version
W: See /tmp/chroot/debootstrap/debootstrap.log for details
W: Failure trying to run: chroot /tmp/chroot mount -t proc proc /proc
W: See /tmp/chroot/debootstrap/debootstrap.log for details

I tried adding various packages to make the emulation work (binfmt-support, qemu-user-static, etc.), without any success.

I first noticed this issue running ubuntu-image on bionic in our spread tests, building images for raspi. I was able to reproduce in a multipass VM with the above command.

ProblemType: Bug
ApportVersion: 2.20.9-0ubuntu7.29
Architecture: amd64
Date: Wed Jan 10 13:59:19 2024
Dependencies:
 adduser 3.116ubuntu1
 apt 1.6.17
 apt-utils 1.6.17
 ca-certificates 20230311ubuntu0.18.04.1
 debconf 1.5.66ubuntu1
 debconf-i18n 1.5.66ubuntu1
 dirmngr 2.2.4-1ubuntu1.6
 dpkg 1.19.0.5ubuntu2.4
 gcc-8-base 8.4.0-1ubuntu1~18.04
 gnupg 2.2.4-1ubuntu1.6
 gnupg-l10n 2.2.4-1ubuntu1.6
 gnupg-utils 2.2.4-1ubuntu1.6
 gpg 2.2.4-1ubuntu1.6
 gpg-agent 2.2.4-1ubuntu1.6
 gpg-wks-client 2.2.4-1ubuntu1.6
 gpg-wks-server 2.2.4-1ubuntu1.6
 gpgconf 2.2.4-1ubuntu1.6
 gpgsm 2.2.4-1ubuntu1.6
 gpgv 2.2.4-1ubuntu1.6
 libacl1 2.2.52-3build1
 libapt-inst2.0 1.6.17
 libapt-pkg5.0 1.6.17
 libasn1-8-heimdal 7.5.0+dfsg-1ubuntu0.4
 libassuan0 2.5.1-2
 libattr1 1:2.4.47-2build1
 libaudit-common 1:2.8.2-1ubuntu1.1
 libaudit1 1:2.8.2-1ubuntu1.1
 libbz2-1.0 1.0.6-8.1ubuntu0.2
 libc6 2.27-3ubuntu1.6
 libcap-ng0 0.7.7-3.1
 libcom-err2 1.44.1-1ubuntu1.4
 libdb5.3 5.3.28-13.1ubuntu1.1
 libffi6 3.2.1-8
 libgcc1 1:8.4.0-1ubuntu1~18.04
 libgcrypt20 1.8.1-4ubuntu1.3
 libgmp10 2:6.1.2+dfsg-2ubuntu0.1
 libgnutls30 3.5.18-1ubuntu1.6
 libgpg-error0 1.27-6
 libgpm2 1.20.7-5
 libgssapi3-heimdal 7.5.0+dfsg-1ubuntu0.4
 libhcrypto4-heimdal 7.5.0+dfsg-1ubuntu0.4
 libheimbase1-heimdal 7.5.0+dfsg-1ubuntu0.4
 libheimntlm0-heimdal 7.5.0+dfsg-1ubuntu0.4
 libhogweed4 3.4.1-0ubuntu0.18.04.1
 libhx509-5-heimdal 7.5.0+dfsg-1ubuntu0.4
 libidn2-0 2.0.4-1.1ubuntu0.2
 libkrb5-26-heimdal 7.5.0+dfsg-1ubuntu0.4
 libksba8 1.3.5-2ubuntu0.18.04.2
 libldap-2.4-2 2.4.45+dfsg-1ubuntu1.11
 libldap-common 2.4.45+dfsg-1ubuntu1.11
 liblocale-gettext-perl 1.07-3build2
 liblz4-1 0.0~r131-2ubuntu3.1
 liblzma5 5.2.2-1.3ubuntu0.1
 libncursesw5 6.1-1ubuntu1.18.04.1
 libnettle6 3.4.1-0ubuntu0.18.04.1
 libnpth0 1.5-3
 libp11-kit0 0.23.9-2ubuntu0.1
 libpam-modules 1.1.8-3.6ubuntu2.18.04.6
 libpam-modules-bin 1.1.8-3.6ubuntu2.18.04.6
 libpam0g 1.1.8-3.6ubuntu2.18.04.6
 libpcre3 2:8.39-9ubuntu0.1
 libpsl5 0.19.1-5build1
 libreadline7 7.0-3
 libroken18-heimdal 7.5.0+dfsg-1ubuntu0.4
 libsasl2-2 2.1.27~101-g0780600+dfsg-3ubuntu2.4
 libsasl2-modules 2.1.27~101-g0780600+dfsg-3ubuntu2.4
 libsasl2-modules-db 2.1.27~101-g0780600+dfsg-3ubuntu2.4
 libseccomp2 2.5.1-1ubuntu1~18.04.2
 libselinux1 2.7-2build2
 libsemanage-common 2.7-2build2
 libsemanage1 2.7-2build2
 libsepol1 2.7-1ubuntu0.1
 libsmartcols1 2.31.1-0.4ubuntu3.7
 libsqlite3-0 3.22.0-1ubuntu0.7
 libssl1.1 1.1.1-1ubuntu2.1~18.04.23
 libstdc++6 8.4.0-1ubuntu1~18.04
 libsystemd0 237-3ubuntu10.57
 libtasn1-6 4.13-2
 libtext-charwidth-perl 0.04-7.1
 libtext-iconv-perl 1.7-5build6
 libtext-wrapi18n-perl 0.06-7.1
 libtinfo5 6.1-1ubuntu1.18.04.1
 libudev1 237-3ubuntu10.57
 libunistring2 0.9.9-0ubuntu2
 libuuid1 2.31.1-0.4ubuntu3.7
 libwind0-heimdal 7.5.0+dfsg-1ubuntu0.4
 libzstd1 1.3.3+dfsg-2ubuntu1.2
 lsb-base 9.20170808ubuntu1
 openssl 1.1.1-1ubuntu2.1~18.04.23
 passwd 1:4.5-1ubuntu2.5
 perl-base 5.26.1-6ubuntu0.7
 pinentry-curses 1.1.0-1
 publicsuffix 20180223.1310-1
 readline-common 7.0-3
 tar 1.29b-2ubuntu0.4
 ubuntu-keyring 2018.09.18.1~18.04.2
 uuid-runtime 2.31.1-0.4ubuntu3.7
 wget 1.19.4-1ubuntu2.2
 zlib1g 1:1.2.11.dfsg-0ubuntu2.2
DistroRelease: Ubuntu 18.04
Package: debootstrap 1.0.95ubuntu0.12
PackageArchitecture: all
ProcCpuinfoMinimal:
 processor : 3
 vendor_id : AuthenticAMD
 cpu family : 25
 model : 68
 model name : AMD Ryzen 7 PRO 6850U with Radeon Graphics
 stepping : 1
 microcode : 0xa404102
 cpu MHz : 2694.924
 cache size : 512 KB
 physical id : 0
 siblings : 4
 core id : 3
 cpu cores : 4
 apicid : 3
 initial apicid : 3
 fpu : yes
 fpu_exception : yes
 cpuid level : 16
 wp : yes
 flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw perfctr_core ssbd ibrs ibpb stibp vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr arat npt lbrv nrip_save tsc_scale vmcb_clean pausefilter pfthreshold v_vmsave_vmload vgif umip pku ospke vaes vpclmulqdq rdpid arch_capabilities
 bugs : sysret_ss_attrs spectre_v1 spectre_v2 spec_store_bypass
 bogomips : 5389.84
 TLB size : 1024 4K pages
 clflush size : 64
 cache_alignment : 64
 address sizes : 48 bits physical, 48 bits virtual
 power management:
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=C.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: User Name 4.15.0-212.223-generic 4.15.18
SourcePackage: debootstrap
Tags: bionic uec-images
Uname: Linux 4.15.0-212-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
_MarkForUpload: True

Ken Sharp (kennybobs)
tags: added: amd64 bionic
tags: added: uec-images
Revision history for this message
Ken Sharp (kennybobs) wrote :

Works fine here.

"See /tmp/chroot/debootstrap/debootstrap.log for details"
Would be handy to have that log.

Changed in debootstrap (Ubuntu):
status: New → Incomplete
Revision history for this message
Paul Mars (upils) wrote :

The log file mentioned by debootstrap is already what is displayed, so sadly no new information in it.

How did you test?

Revision history for this message
Ken Sharp (kennybobs) wrote :

> W: See /tmp/chroot/debootstrap/debootstrap.log for details
That log, not what you copied from the console.

Try the following command in a console and post the result:

grep -F BINFMT /boot/config-$(uname -r)

Revision history for this message
Paul Mars (upils) wrote :

You were right about the log. In another situation I looked at it and did not contained information, but here it does.

chroot: failed to run command 'dpkg-deb': No such file or directory
chroot: failed to run command 'mount': No such file or directory

Both these binaries are in the chroot. I understand these binaries are "not found" because they are not run directly but through a "translation" layer provided by qemu-user-static.

 $ grep -F BINFMT /boot/config-$(uname -r)
CONFIG_BINFMT_ELF=y
CONFIG_COMPAT_BINFMT_ELF=y
CONFIG_BINFMT_SCRIPT=y
CONFIG_BINFMT_MISC=m

Both qemu-user-static and binfmt-support are installed on the building machine.

I also noticed that running a second time the debootstrap command, without cleaning the chroot directory, succeed (no error). But if I start again from an empty directory, it fails again.

Ken Sharp (kennybobs)
Changed in debootstrap (Ubuntu):
status: Incomplete → New
Ken Sharp (kennybobs)
Changed in debootstrap (Ubuntu):
status: New → Confirmed
Revision history for this message
Ken Sharp (kennybobs) wrote :

In Bionic you need to use qemu-debootstrap to work around limitations (which are fixed in later releases).

$ sudo qemu-debootstrap --verbose --arch=arm64 --variant=minbase --components=main,restricted,universe,multiverse bionic /tmp/chroot http://ports.ubuntu.com/ubuntu-ports/

Tested and works as expected. Please retry with qemu-debootstrap.

Changed in debootstrap (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.