From 97a9312c46513c842f1dfedfac7bfc4bbafdcb22 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Wed, 14 Jan 2026 04:46:28 +0000 Subject: vcontainer: add vshell command for VM debug access Add vshell command to vdkr/vpdmn for interactive shell access to the QEMU VM where Docker/Podman runs. This is useful for debugging container issues directly inside the virtual environment. Usage: vdkr vmemres start vdkr vshell # Now inside VM, can run docker commands directly docker images docker inspect exit The vshell command requires the memory-resident daemon to be running (vmemres start). It opens an interactive shell via the daemon's --daemon-interactive mode. Signed-off-by: Bruce Ashfield --- .../vcontainer/files/vcontainer-common.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'recipes-containers') diff --git a/recipes-containers/vcontainer/files/vcontainer-common.sh b/recipes-containers/vcontainer/files/vcontainer-common.sh index f10243f1..ddcb674f 100755 --- a/recipes-containers/vcontainer/files/vcontainer-common.sh +++ b/recipes-containers/vcontainer/files/vcontainer-common.sh @@ -330,6 +330,7 @@ ${BOLD}${RUNTIME_UPPER}-COMPATIBLE COMMANDS:${NC} ${CYAN}unpause${NC} Unpause a container ${CYAN}commit${NC} Create image from container ${CYAN}exec${NC} [opts] Execute command in container + ${CYAN}vshell${NC} Open interactive shell in VM (debug) ${CYAN}cp${NC} Copy files to/from container ${BOLD}Registry:${NC} @@ -1565,6 +1566,25 @@ case "$COMMAND" in fi ;; + # VM shell - interactive shell into the VM itself (not a container) + vshell) + # Opens a shell directly in the vdkr/vpdmn VM for debugging + # This runs /bin/sh in the VM, not inside a container + # Useful for: + # - Running docker commands directly to see full error output + # - Debugging VM-level issues + # - Inspecting the VM filesystem + if ! daemon_is_running; then + echo -e "${RED}[$VCONTAINER_RUNTIME_NAME]${NC} vshell requires daemon mode" >&2 + echo "Start daemon with: $VCONTAINER_RUNTIME_NAME vmemres start" >&2 + exit 1 + fi + + echo -e "${CYAN}[$VCONTAINER_RUNTIME_NAME]${NC} Opening VM shell (type 'exit' to return)..." >&2 + RUNNER_ARGS=$(build_runner_args) + "$RUNNER" $RUNNER_ARGS --daemon-interactive -- "/bin/sh" + ;; + # Runtime cp - copy files to/from container cp) if [ ${#COMMAND_ARGS[@]} -lt 2 ]; then -- cgit v1.2.3-54-g00ecf