Conversation
Introduce host directory bind mounts for libkrun VM sandboxes using the virtiofs4 API with simplified permission semantics. The gateway accepts `enable_bind_mounts` in the `[openshell.drivers.vm]` TOML table and forwards it to the VM driver subprocess. Mounts are specified per-sandbox in driver_config.mounts[] with source, target, and optional read_only fields (default: read-write). The driver validates paths against reserved VM-internal directories, generates virtiofs tags, writes a guest-side manifest into the overlay disk, and the init script mounts the shares at boot. Kernel config adds CONFIG_FUSE_FS and CONFIG_VIRTIO_FS to support the virtiofs filesystem in the guest. Signed-off-by: Florent Benoit <fbenoit@redhat.com>
benoitf
requested review from
a team,
derekwaynecarr,
mrunalp and
sjenning
as code owners
September 18, 2026 15:21
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
Add host directory bind mount support for libkrun VM sandboxes via the virtiofs4 API with simplified permission semantics. Operators enable the feature with
enable_bind_mounts = truein[openshell.drivers.vm], and sandbox creators specify mounts indriver_config.mounts[].note: it depends on a new release of kernel published at https://github.com/NVIDIA/OpenShell/actions/workflows/release-vm-kernel.yml for pre-built vm (with newer libkrun)
Related Issue
#2585
Changes
openshell-gateway): Acceptenable_bind_mountsinVmComputeConfigand forward as--enable-bind-mountsCLI flag to the VM driver subprocessopenshell-driver-vm): Addkrun_add_virtiofs4binding (6-arg: ctx, tag, path, shm_size, read_only, semantics)openshell-driver-vm): NewVmMounttype andadd_virtiofs()method calling virtiofs4 withSEMANTICS_SIMPLIFIEDopenshell-driver-vm):VmMountConfigdeserialization, path validation against reserved VM-internal directories, virtiofs tag generation, guest mount manifest injection into overlay disk,--vm-mountCLI arg forwardingmount_virtiofs_shares()reads/.openshell/mounts.manifestand mounts virtiofs shares at bootCONFIG_FUSE_FSandCONFIG_VIRTIO_FSfor guest virtiofs supportenable_bind_mountstogateway-config.mdxreferenceTesting
enable_bind_mounts, rejects QEMU, rejects relative source, rejects file source, rejects reserved paths, rejects duplicates)--vm-mountCLI arg parsingdriver_config.mountsand verify host directory is accessible in guestChecklist
gateway-config.mdx)mise run pre-commitpassesmise run testpasses