-
Notifications
You must be signed in to change notification settings - Fork 93
Box fails to start when passing my host env vars:Timeout waiting for guest ready (30s) #222
Description
I'm building an Electron App with an agent that uses BoxLite. I accidentally passed process.env to Node SDK by SimpleBox. I encountered this error:Timeout waiting for guest ready (30s)
I ran ./target/debug/boxlite run --rm $(printenv | sed 's/=.*//;s/^/-e /' | tr '\n' ' ') docker.io/library/alpine:latest echo ok, got the same error.
How to reproduce
./target/debug/boxlite run --rm $(printenv | sed 's/=.*//;s/^/-e /' | tr '\n' ' ') docker.io/library/alpine:latest echo ok
env var numbers
(base) goranka@fengbolins-MacBook-Pro boxlite % printenv | wc -l
59
Execution log
(base) goranka@fengbolins-MacBook-Pro boxlite % ./target/debug/boxlite run --rm $(printenv | sed 's/=.*//;s/^/-e /' | tr '\n' ' ') docker.io/library/alpine:latest echo ok
2026-02-09T10:42:51.970325Z INFO boxlite::runtime::rt_impl: Virtualization support verified reason=Hypervisor.framework is available (Apple Silicon)
2026-02-09T10:42:52.013417Z INFO boxlite::runtime::rt_impl: Recovering 35 boxes from database
2026-02-09T10:42:52.019730Z INFO boxlite::runtime::rt_impl: Box recovery complete
2026-02-09T10:42:52.203141Z INFO boxlite::images::store: Using cached image: docker.io/library/alpine:latest
2026-02-09T10:42:52.203202Z INFO boxlite::litebox::init::tasks::container_rootfs: Using cached disk image: /Users/goranka/.boxlite/images/disk-images/sha256-71a4daca31190bb2ea2308feeacebf5c459648262dc1ba9eae88b9507193e708.ext4 (256MB)
2026-02-09T10:42:52.204392Z INFO boxlite::disk::qcow2: Creating COW child disk: /Users/goranka/.boxlite/boxes/01KH0ZYEZMZEBYKYTTT8ZRD4MQ/disk.qcow2 (backing: /Users/goranka/.boxlite/images/disk-images/sha256-71a4daca31190bb2ea2308feeacebf5c459648262dc1ba9eae88b9507193e708.ext4, format: raw)
2026-02-09T10:42:52.211097Z INFO boxlite::disk::qcow2: Created COW child disk: /Users/goranka/.boxlite/boxes/01KH0ZYEZMZEBYKYTTT8ZRD4MQ/disk.qcow2
2026-02-09T10:42:52.211112Z INFO boxlite::litebox::init::tasks::container_rootfs: Created container rootfs COW overlay (persistent) cow_disk=/Users/goranka/.boxlite/boxes/01KH0ZYEZMZEBYKYTTT8ZRD4MQ/disk.qcow2 base_disk=/Users/goranka/.boxlite/images/disk-images/sha256-71a4daca31190bb2ea2308feeacebf5c459648262dc1ba9eae88b9507193e708.ext4 virtual_size_mb=256
2026-02-09T10:42:52.211173Z INFO boxlite::litebox::init::tasks::guest_rootfs: Initializing bootstrap guest rootfs debian:bookworm-slim (first time only)
2026-02-09T10:42:52.211660Z INFO boxlite::images::store: Using cached image: docker.io/library/debian:bookworm-slim
2026-02-09T10:42:52.235057Z INFO boxlite::litebox::init::tasks::guest_rootfs: Using cached guest rootfs disk image: /Users/goranka/.boxlite/images/disk-images/sha256-cbdf6298da7f082bf2694d331308958f14612d8d044134d23c9d31a90f8dac93.ext4
2026-02-09T10:42:52.235072Z INFO boxlite::litebox::init::tasks::guest_rootfs: Bootstrap guest rootfs ready: Disk { disk_path: "/Users/goranka/.boxlite/images/disk-images/sha256-cbdf6298da7f082bf2694d331308958f14612d8d044134d23c9d31a90f8dac93.ext4", device_path: None }
2026-02-09T10:42:52.235103Z INFO boxlite::disk::qcow2: Creating COW child disk: /Users/goranka/.boxlite/boxes/01KH0ZYEZMZEBYKYTTT8ZRD4MQ/guest-rootfs.qcow2 (backing: /Users/goranka/.boxlite/images/disk-images/sha256-cbdf6298da7f082bf2694d331308958f14612d8d044134d23c9d31a90f8dac93.ext4, format: raw)
2026-02-09T10:42:52.240847Z INFO boxlite::disk::qcow2: Created COW child disk: /Users/goranka/.boxlite/boxes/01KH0ZYEZMZEBYKYTTT8ZRD4MQ/guest-rootfs.qcow2
2026-02-09T10:42:52.240857Z INFO boxlite::litebox::init::tasks::guest_rootfs: Created guest rootfs COW overlay (persistent) cow_disk=/Users/goranka/.boxlite/boxes/01KH0ZYEZMZEBYKYTTT8ZRD4MQ/guest-rootfs.qcow2 base_disk=/Users/goranka/.boxlite/images/disk-images/sha256-cbdf6298da7f082bf2694d331308958f14612d8d044134d23c9d31a90f8dac93.ext4
2026-02-09T10:42:52.242462Z INFO boxlite::litebox::init::tasks::vmm_spawn: Port mappings: 0 (image: 0, user: 0, overridden: 0)
2026-02-09T10:42:52.243162Z INFO boxlite::vmm::controller::shim: Starting Box subprocess engine=Libkrun transport=Unix { socket_path: "/Users/goranka/.boxlite/boxes/01KH0ZYEZMZEBYKYTTT8ZRD4MQ/sockets/box.sock" }
2026-02-09T10:42:52.243187Z INFO boxlite::jailer::command: Jailer disabled, running shim without sandbox isolation
2026-02-09T10:42:52.245012Z INFO boxlite::vmm::controller::shim: boxlite-shim subprocess spawned box_id=01KH0ZYEZMZEBYKYTTT8ZRD4MQ pid=77442 shim_spawn_duration_ms=1
2026-02-09T10:42:52.245379Z INFO boxlite::vmm::controller::shim: VM subprocess started successfully box_id=01KH0ZYEZMZEBYKYTTT8ZRD4MQ
2026-02-09T10:43:22.246571Z ERROR boxlite::litebox::init::tasks: Task failed: engine reported an error: Timeout waiting for guest ready (30s). Check logs: ~/.boxlite/logs/boxlite-shim.log, and system: dmesg | grep -i 'apparmor|kvm' box_id=01KH0ZYEZMZEBYKYTTT8ZRD4MQ task=guest_connect
2026-02-09T10:43:22.247204Z WARN boxlite::litebox::init::types: Box initialization failed, cleaning up
Error: engine reported an error: Timeout waiting for guest ready (30s). Check logs: ~/.boxlite/logs/boxlite-shim.log, and system: dmesg | grep -i 'apparmor|kvm'
~/.boxlite/logs/boxlite-shim.log.2026-02-09 content
2026-02-09T10:42:52.270774Z INFO boxlite_shim: Box runner starting engine=Libkrun box_id=01KH0ZYEZMZEBYKYTTT8ZRD4MQ
2026-02-09T10:42:52.271174Z INFO boxlite_shim: Creating network backend (gvproxy) from config port_mappings=[]
2026-02-09T10:42:52.275360Z INFO gvproxy: Created UnixDgram socket for VFKit protocol path=/var/folders/2f/y6cfh42j16bclmgybwljk8hw0000gn/T/gvproxy-1.sock
2026-02-09T10:42:52.275522Z INFO gvproxy: Created gvproxy instanceid1socket/var/folders/2f/y6cfh42j16bclmgybwljk8hw0000gn/T/gvproxy-1.sockprotocolvfkit
2026-02-09T10:42:52.275534Z INFO boxlite::net::gvproxy::ffi: Created gvproxy instance via FFI id=1
2026-02-09T10:42:52.275539Z INFO boxlite::net::gvproxy::instance: Created GvproxyInstance id=1
2026-02-09T10:42:52.275901Z INFO boxlite_shim: Network backend created socket_path="/var/folders/2f/y6cfh42j16bclmgybwljk8hw0000gn/T/gvproxy-1.sock"
2026-02-09T10:42:52.276456Z INFO boxlite_shim: Engine created, creating Box instance
2026-02-09T10:42:52.279184Z INFO boxlite::vmm::krun::engine: Configuring network connection connection=UnixSocket { path: "/var/folders/2f/y6cfh42j16bclmgybwljk8hw0000gn/T/gvproxy-1.sock", connection_type: UnixDgram, mac_address: [90, 148, 239, 228, 12, 238] }
2026-02-09T10:42:52.279199Z INFO boxlite::vmm::krun::engine: Configuring Unix socket net path="/var/folders/2f/y6cfh42j16bclmgybwljk8hw0000gn/T/gvproxy-1.sock" connection_type=UnixDgram mac_address=[90, 148, 239, 228, 12, 238]
2026-02-09T10:42:52.279579Z INFO boxlite::vmm::krun::engine: Adding filesystem shares via virtiofs:
2026-02-09T10:42:52.279588Z INFO boxlite::vmm::krun::engine: BoxLiteShared → /Users/goranka/.boxlite/boxes/01KH0ZYEZMZEBYKYTTT8ZRD4MQ/shared (rw)
2026-02-09T10:42:52.279596Z INFO boxlite::vmm::krun::engine: Attaching block devices:
2026-02-09T10:42:52.279599Z INFO boxlite::vmm::krun::engine: vda → /Users/goranka/.boxlite/boxes/01KH0ZYEZMZEBYKYTTT8ZRD4MQ/disk.qcow2 (qcow2, read-write)
2026-02-09T10:42:52.279604Z INFO boxlite::vmm::krun::engine: vdb → /Users/goranka/.boxlite/boxes/01KH0ZYEZMZEBYKYTTT8ZRD4MQ/guest-rootfs.qcow2 (qcow2, read-write)
2026-02-09T10:42:52.279609Z INFO boxlite::vmm::krun::engine: Configuring guest rootfs disk remount: /dev/vdb
2026-02-09T10:42:52.280851Z INFO boxlite_shim: Box instance created, handing over process control to Box
2026-02-09T10:42:52.280869Z INFO boxlite_shim: Parent watchdog started (detach=false) parent_pid=77401