From 69735ce846df6f91ac72647a21ad87ff515cf16e Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 28 Sep 2026 14:03:46 +0200 Subject: [PATCH] ephemeral: Preserve stdin for an interactive console Bash redirects stdin from a background job to /dev/null when job control is off. Preserve Podman stdin through bwrap so QEMU can receive console input with -it. Assisted-by: AI Signed-off-by: Alexander Larsson --- crates/kit/scripts/entrypoint.sh | 4 +++- docs/src/man/bcvk-ephemeral-run.md | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/kit/scripts/entrypoint.sh b/crates/kit/scripts/entrypoint.sh index 06474ff2f..ecb8094a8 100644 --- a/crates/kit/scripts/entrypoint.sh +++ b/crates/kit/scripts/entrypoint.sh @@ -67,7 +67,9 @@ trap 'kill -TERM $BWRAP_PID 2>/dev/null; exit 0' INT TERM # Run bwrap in background so we can handle signals; xref # https://github.com/containers/bubblewrap/pull/586 # But probably really we should switch to systemd -bwrap --as-pid-1 --unshare-pid "${BWRAP_ARGS[@]}" --bind /run /run -- ${SELFEXE} container-entrypoint "$@" & +# Bash normally gives a background command /dev/null on stdin, so +# keep stdin attached so QEMU can receive input. +bwrap --as-pid-1 --unshare-pid "${BWRAP_ARGS[@]}" --bind /run /run -- ${SELFEXE} container-entrypoint "$@" <&0 & BWRAP_PID=$! # Wait for bwrap to complete diff --git a/docs/src/man/bcvk-ephemeral-run.md b/docs/src/man/bcvk-ephemeral-run.md index 7de1c3e04..a00a264d9 100644 --- a/docs/src/man/bcvk-ephemeral-run.md +++ b/docs/src/man/bcvk-ephemeral-run.md @@ -67,6 +67,7 @@ This design allows bcvk to provide VM-like isolation and boot behavior while lev **--console** Connect the QEMU console to the container's stdio (visible via podman logs/attach) + Add **-i -t** to send keyboard input to the guest console. **--debug** @@ -216,7 +217,7 @@ run and SSH into one command with automatic cleanup. **Debugging boot issues**: - bcvk ephemeral run --console --name debugvm localhost/mybootc + bcvk ephemeral run --console -it --name debugvm localhost/mybootc ## Understanding the Flags