Skip to content

mmdebstrap container build fails with Bad fd number when running with Rosetta #2543

Description

@mp1-tomclancy

Describe the bug

When building a debian:trixie based image and running the mmdebstrap tool with Rosetta, the build fails with the following error:

3.851 /bin/sh: 1: Syntax error: Bad fd number
3.851 Fetched 25.3 MB in 1s (21.8 MB/s)
3.851 E: Sub-process cat >&10 returned an error code (2)
3.851 E: Failure running script cat >&10
3.855 E: apt download failed: E: apt-get --yes -oDebug::pkgDpkgPm=1 -oDir::Log=/dev/null -oAPT::Keep-Fds::=10 -oDPkg::Tools::options::'cat >&10'::InfoFD=10 -oDpkg::Pre-Install-Pkgs::=cat >&10 -oDebug::NoLocking=1 -oDpkg::Use-Pty=0 -oDPkg::Chroot-Directory= install ?narrow(?or(?archive(^trixie$),?codename(^trixie$)),?architecture(amd64),?essential) -oAPT::Status-Fd=<$fd> -oDpkg::Use-Pty=false failed: process exited with 100 and error in console output
3.856 W: hooklistener errored out: E: received eof on socket
3.856 
3.856 I: main() received signal PIPE: waiting for setup...
3.861 I: removing tempdir /tmp/mmdebstrap.5dU4LWMUbf...
3.886 E: mmdebstrap failed to run

I cannot reproduce the error on native hardware (both aarch64 and amd64), or when disabling Rosetta in Orbstack. Based on my debugging, I don't think it's specific to mmdebstrap but seems related to how file descriptors are allocated under Rosetta.

To Reproduce

  1. Ensure Use Rosetta to run Intel code is enabled
  2. Download the Dockerfile provided in additional context
  3. Run docker build --platform=linux/amd64 -t mmdebstrap-repro .

Expected behavior

docker build ... should complete without error

Diagnostic report (REQUIRED)

OrbStack info:
Version: 2.2.1
Commit: 0e182b501fcd9e05b99ffb363fce03610390c400 (v2.2.1)

System info:
macOS: 26.5 (25F71)
CPU: arm64, 10 cores
CPU model: Apple M5
Model: Mac17,2
Memory: 24 GiB

Full report: https://orbstack.dev/_admin/diag/orbstack-diagreport_2026-06-15T23-04-25.398135Z.zip

Screenshots and additional context (optional)

Dockerfile

FROM debian:trixie

RUN apt-get update && \
    apt-get install -y --no-install-recommends wget ca-certificates mmdebstrap

# Bootstrap a minimal trixie rootfs from the public Debian mirror.
RUN mmdebstrap --variant=minbase trixie /tmp/rootfs.tar

Metadata

Metadata

Assignees

No one assigned

    Labels

    t/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions