Skip to content

VM's: run first-boot units without debconf dialogs - #121

Merged
MickLesk merged 1 commit into
mainfrom
fix/firstboot-noninteractive
Oct 8, 2026
Merged

MickLesk merged 1 commit into
mainfrom
fix/firstboot-noninteractive

Conversation

@MickLesk

@MickLesk MickLesk commented Oct 8, 2026

Copy link
Copy Markdown
Member

A first-boot script that runs apt (Waydroid, NetBird's Docker install) let needrestart draw its "Pending kernel upgrade" dialog on the serial console; whiptail then failed with "Failed to open terminal" and Perl warnings. The generated unit now carries Environment=DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a NEEDRESTART_SUSPEND=1, so this holds for every first-boot script without each having to set it.

Covered in tests/vm-helpers.sh; the unit passes systemd-analyze verify.

A first-boot script that calls apt let needrestart draw its kernel-upgrade dialog on the serial console, where whiptail then gave up with Perl warnings. The unit sets DEBIAN_FRONTEND=noninteractive and needrestart's automatic mode for every script.
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Try this branch

The engine and the scripts resolve independently, so a production script can
be run against the engine from this PR by setting one variable:

COMMUNITY_SCRIPTS_CORE_URL=https://raw.githubusercontent.com/community-scripts/core/fix/firstboot-noninteractive \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/debian.sh)"

Swap ct/debian.sh for whatever exercises the change.

Run a script from a fork as well
curl -fsSL https://raw.githubusercontent.com/community-scripts/core/fix/firstboot-noninteractive/tools/run.sh |
  bash -s -- https://raw.githubusercontent.com/YOU/DevScripts/your-branch ct/debian.sh \
             https://raw.githubusercontent.com/community-scripts/core/fix/firstboot-noninteractive

Note that run.sh is reached through a pipe, so the script it starts inherits
an exhausted stdin. Whiptail is fine — it opens /dev/tty — but a plain read
would see EOF. The single-variable form above does not have that problem.

Useful flags while testing

dev_mode=net logs every engine fetch with status and duration, which is the
quickest way to confirm the branch is really being used. dev_mode=keep stops a
failed build from deleting the container along with the evidence.

@MickLesk MickLesk changed the title Run first-boot units without debconf dialogs VM's: run first-boot units without debconf dialogs Oct 8, 2026
@MickLesk
MickLesk merged commit db14d01 into main Oct 8, 2026
4 checks passed
@github-actions
github-actions Bot deleted the fix/firstboot-noninteractive branch October 8, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant