Skip to content

fix(export): stop shipping the guest rootfs disk in box archives - #1075

Closed
G4614 wants to merge 1 commit into
boxlite-ai:mainfrom
G4614:feat/export-skip-guest-rootfs
Closed

fix(export): stop shipping the guest rootfs disk in box archives#1075
G4614 wants to merge 1 commit into
boxlite-ai:mainfrom
G4614:feat/export-skip-guest-rootfs

Conversation

@G4614

@G4614 G4614 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Box archives no longer carry the guest rootfs disk, which is host-global state the importing host rebuilds from its own version-keyed cache.

It is a thin COW overlay over the shared guest rootfs cache (keyed by bootstrap image + guest binary version) and holds no user state; clone and snapshot-restore already treat it as disposable. Export was the exception, and flattening stripped its backing reference, so an imported box booted from the archived copy instead of the importing host's correctly-versioned cache. No archive version bump — the disk was already optional, so old importers handle its absence and new ones ignore its presence.

Test plan:

  • cargo nextest run -p boxlite --no-default-features --lib -E 'test(~export_omits_the_guest_rootfs_disk)' — new regression test
  • Two-side verified: with all production changes reverted the test still compiles and fails on its assertion, got ["manifest.json", "disk.qcow2", "guest-rootfs.qcow2"]; restored, it passes
  • make test:integration:rust FILTER=export — 15/15 passed (real VM), including test_export_import_roundtrip, which imports and then starts the box
  • cargo nextest run -p boxlite --no-default-features --lib — 952/954; the two failures (seatbelt sandbox, vendored-libkrun source read) reproduce on a pristine tree
  • cargo fmt --all -- --check, cargo clippy -p boxlite --no-default-features --all-targets -- -D warnings

The guest rootfs disk is a thin COW overlay over the host-global guest
rootfs cache, keyed by the bootstrap image plus guest binary version. It
holds no user state, and clone and snapshot-restore already treat it as
disposable: when it is absent, the next start recreates the overlay from
the local cache.

Export was the exception. It flattened the overlay into the archive,
which both bloated every archive with a host-independent blob and
stripped the backing reference, so an imported box would boot from the
archived copy instead of the importing host's correctly-versioned cache.

Export now omits it and import never installs one, even from an older
archive. No archive version bump: the disk was already optional, since a
never-started box exported without it, so old importers handle its
absence and new importers ignore its presence. guest_disk_checksum stays
on the manifest, always empty, so older importers still parse it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 908502bc-86ae-4278-96da-13c23f7da4ab

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@G4614

G4614 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #1080 — that PR already contained this commit, so keeping them split cost an extra review without shrinking the diff.

@G4614 G4614 closed this Jul 29, 2026
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