fix(snap): ship the VM compute driver - #2894
Open
alexclewontin wants to merge 1 commit into
Open
Conversation
The snap advertised the vm compute driver but never staged its binary, so selecting it crash-looped the gateway with "vm compute driver binary not found". Stage openshell-driver-vm and expose it at the conventional /usr/libexec/openshell path with a snapcraft layout symlink, and add the kvm plug the driver needs to reach /dev/kvm. Sandbox creation then failed while formatting the rootfs. core24 ships mke2fs, mkfs.ext4 and debugfs under /usr/sbin, but the snap AppArmor profile denies execve on base-snap sbin binaries: they resolve on PATH and then fail with EACCES, so a presence check cannot detect the problem. Vendor e2fsprogs into $SNAP/usr/sbin, which the snap PATH already prefers. Point build:rust:snap at the VM runtime directory. Without OPENSHELL_VM_RUNTIME_COMPRESSED_DIR the driver's build.rs embeds empty stub resources and exits 0, producing a binary that passes --version and only fails later at sandbox creation; add a precondition so a stub build fails loudly instead. Cover the packaging in release-canary so a future regression that drops the driver or breaks the layout is caught before publishing. Verified by packing the snap, installing it, and creating a VM sandbox end to end: the guest boots and exec returns from inside the microVM. Signed-off-by: Alex Lewontin <alex.lewontin@canonical.com>
alexclewontin
requested review from
a team,
derekwaynecarr,
mrunalp and
sjenning
as code owners
August 22, 2026 02:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The OpenShell snap never packaged it the vm compute driver binary, so selecting it crash-looped the gateway. This stages
openshell-driver-vmin the snap, exposes it at the conventional/usr/libexec/openshellpath via a snapcraftlayout:, and vendors thee2fsprogstooling the driver shells out to. A VM sandbox now boots from an installed snap.Related Issue
No issue required: localized packaging bug fix, and the diff plus verification below carries enough context to review the decision and implementation together.
Changes
snapcraft.yamlopenshell-driver-vmto$SNAP/usr/libexec/openshell/and add a top-levellayout:symlinking/usr/libexec/openshellonto it, so the gateway's existing search path resolves inside confinement with nodriver_dirpin.kvmplug to thegatewayapp so the driver can open/dev/kvm.e2fsprogspart staged into$SNAP/usr/sbin..github/workflows/snap-package.yml— download and stage thedriver-vm-linux-<arch>artifact; include the driver in the staging completeness check..github/workflows/release-dev.yml,release-tag.yml—build-snapnow depends onbuild-driver-vm-linux..github/workflows/release-canary.yml— assert the driver resolves at its layout path inside the installed snap.tasks/ci.toml— setOPENSHELL_VM_RUNTIME_COMPRESSED_DIRforbuild:rust:snapand fail loudly when the runtime is absent.docs/about/installation.mdx, runtime layout inarchitecture/build.md, packaging ande2fsprogsnotes incrates/openshell-driver-vm/README.md.Testing
mise run pre-commitpassesrelease-canaryassertion covers driver presence and layout resolution. Booting a microVM needs nested virtualization on the runner, which the canary environment does not provide.Manual end-to-end on Ubuntu 26.04, amd64, strict confinement:
--dangerous.meta/snap.yamlcarries thelayout:mapping andkvmin the gateway plugs;unsquashfsshows the driver atusr/libexec/openshell/openshell-driver-vm.test -f /usr/libexec/openshell/openshell-driver-vm(the exact checkresolve_compute_driver_binperforms) is true, and the binary executes through that path.nprocandMemTotalmatch the configuredvcpus = 2/mem_mib = 2048, confirming the VM came from the driver.Checklist