Skip to content

fix(serve,guest): volumes support, debugfs quoting, devtmpfs mount#360

Open
yan5xu wants to merge 2 commits intoboxlite-ai:mainfrom
yan5xu:fix/serve-volumes-and-devtmpfs
Open

fix(serve,guest): volumes support, debugfs quoting, devtmpfs mount#360
yan5xu wants to merge 2 commits intoboxlite-ai:mainfrom
yan5xu:fix/serve-volumes-and-devtmpfs

Conversation

@yan5xu
Copy link
Contributor

@yan5xu yan5xu commented Mar 9, 2026

Summary

Three fixes for BoxLite serve mode:

  1. serve: add volumes to CreateBoxRequest — Without this, virtiofs mounts passed in the create request were silently dropped. Containers couldn't see host-mounted directories (e.g. /clip).

  2. disk/ext4: quote host path in debugfs write — On macOS, the embedded runtime extracts to ~/Library/Application Support/boxlite/.... The space in "Application Support" caused debugfs write to silently fail, leaving the guest binary missing from the rootfs ext4 image.

  3. guest: mount devtmpfs at /dev — The kernel sees block devices in /proc/partitions but /dev/vd* device nodes were never created. This prevented Container.Init from mounting the container disk.

Test plan

  • boxlite serve → create box with volumes → exec /bin/echo hello → stdout received
  • Guest binary correctly injected into rootfs (no "No such file or directory")
  • Container sees virtiofs volumes at expected mount points
  • apt-get install curl git python3 works inside container (10GB disk)
  • HTTPS connectivity verified (curl https://www.google.com)

🤖 Generated with Claude Code

yan5xu and others added 2 commits March 9, 2026 19:32
Holds a single BoxliteRuntime and exposes box lifecycle + exec operations
over HTTP. Solves runtime lock contention when multiple callers need
concurrent access (e.g. Pinix Server executing nested clip-to-clip calls).

Endpoints (9, MVP):
- GET  /v1/config
- POST /v1/local/boxes (create)
- GET  /v1/local/boxes (list)
- GET  /v1/local/boxes/{id} (info)
- POST /v1/local/boxes/{id}/start
- POST /v1/local/boxes/{id}/stop
- POST /v1/local/boxes/{id}/exec (returns execution_id, supports stdin)
- GET  /v1/local/boxes/{id}/executions/{eid}/output (SSE stream)
- DELETE /v1/local/boxes/{id}

SSE exec protocol:
  event: stdout, data: {"data":"<base64>"}
  event: stderr, data: {"data":"<base64>"}
  event: exit, data: {"exit_code":0,"duration_ms":1234}

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Three fixes for BoxLite serve mode:

1. serve: add volumes field to CreateBoxRequest and pass to BoxOptions
   - Without this, virtiofs mounts were silently dropped and /clip
     was not visible inside containers

2. disk/ext4: quote host path in debugfs write command
   - Paths containing spaces (macOS "Application Support") caused
     debugfs to silently fail, leaving guest binary missing from rootfs

3. guest: mount devtmpfs at /dev for block device node auto-creation
   - Kernel sees block devices in /proc/partitions but /dev/vd* nodes
     were missing, preventing Container.Init from mounting disks

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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