Add SMB volume driver via direct guest CIFS mount#1428
Add SMB volume driver via direct guest CIFS mount#1428tonycoco wants to merge 2 commits intoapple:mainfrom
Conversation
Add --driver smb to container volume create. SMB volumes store the share path and credentials as metadata with no block image. At container start, they are resolved into a cifs mount directly inside the Linux guest rather than going through virtiofs. Supported driver opts: share, username, password, domain.
|
@tonycoco Could you fix the conflicts? Thanks for the contribution, I need to take a closer look but this seems fine. One thing to note is that changing the Users would need to build and specify their own kernel that includes SMB and/or NFS client capability. One possible alternative/workaround would be if the public homebrew recipe (which isn't managed by the Containerization project maintainers, incidentally) were capable of building and installing a default kernel from using a more expansive config that it embeds. |
7e83293 to
476a9c0
Compare
476a9c0 to
b2d6e10
Compare
|
@jglogan Merge conflicts are now fixed. I have commits for the kernel and upstream kata as well in the loop but at least this unlocks the container side of things. I also have some changes to the Reference: apple/containerization#681 Tracking: |
|
@tonycoco Thanks! I'll let @dcantah handle apple/containerization#681 as he's already working with you on it. |
|
Looks good and also kata-containers/kata-containers#12374 has been merged! |
Add NFS and SMB volume drivers via direct guest mounts
Adds
--driver nfsand--driver smbtocontainer volume create. Both drivers mount network shares directly inside the Linux guest rather than going throughvirtiofs, eliminating the host-side mount hop.When a volume is created with
--driver smbor--driver nfs, no block image is created. The share path and options are stored as volume metadata. At container start,Utility.swiftresolves the volume into aFilesystem.smborFilesystem.nfsmount, whichSandboxService.swifttranslates into a.anyguest mount with typecifsornfsrespectively.Usage:
SMB
NFS
Boolean mount flags (e.g.
nolock,mfsymlinks) can be passed as--opt nolock=with an empty value and are serialized as bare flags in the mount data string.Kernel requirement
This depends on a pending change to apple/containerization. The default guest kernel ships with
CONFIG_CIFS=ydisabled. A PR to that repo is needed to enable it inkernel/config-arm64— without it, SMB mounts fail at runtime witherrno 19 (ENODEV). NFS (CONFIG_NFS_FS) is already enabled in the current kernel config but is not compiled into the shipped kernel binary, so a rebuild is required for both drivers to work end-to-end.The required containerization change is a single line in
kernel/config-arm64:Type of Change
Motivation and Context
#1413
Testing