{"record":{"id":"d389f8b8b955190c","repo":"lima-vm/lima","slug":"unsupported-filesystem-type-q-for-fstab-entry","errorCode":null,"errorMessage":"unsupported filesystem type %#q for fstab entry: %v","messagePattern":"unsupported filesystem type %#q for fstab entry: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/guestagent/fakecloudinit/fakecloudinit_darwin.go","lineNumber":155,"sourceCode":"\tif len(userData.BootCmd) > 0 {\n\t\tlogrus.Warn(\"bootcmd is not implemented\")\n\t}\n\treturn errors.Join(errs...)\n}\n\n// mountFSTabEntry mounts a filesystem based on the given fstab entry.\n// The format mimics Linux's convention.\n// The entries are not written to /etc/fstab.\nfunc mountFSTabEntry(m []string) error {\n\tif len(m) != 6 {\n\t\treturn fmt.Errorf(\"invalid fstab entry: expected 6 fields, got %d: %v\", len(m), m)\n\t}\n\tsrc, dst, fsType := m[0], m[1], m[2]\n\tswitch fsType {\n\tcase \"virtiofs\":\n\t\treturn mountVirtiofs(src, dst)\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported filesystem type %#q for fstab entry: %v\", fsType, m)\n\t}\n}\n\n// mountVirtiofs symlinks `/Volumes/My Shared Files/<pseudoTag>` (automatically mounted by macOS) to dir.\n// dir must not exist, or, must be a symlink to the expected source.\nfunc mountVirtiofs(pseudoTag, dir string) error {\n\tif strings.Contains(pseudoTag, string(filepath.Separator)) {\n\t\treturn fmt.Errorf(\"invalid pseudo tag for virtiofs: %#q\", pseudoTag)\n\t}\n\tlnSrc := filepath.Join(\"/Volumes/My Shared Files\", pseudoTag)\n\n\t// FIXME: verify that the filesystem of lnSrc is indeed read-only when user-data contains the \"ro\" option.\n\t// unix.Statfs() could be used, but unix.Statfs_t.Flags & unix.MNT_RDONLY seems always 0 for virtiofs.\n\t// `mount -v` does not show \"ro\" flag either.\n\n\tlnExisting, err := os.Readlink(dir)\n\tif err == nil {\n\t\tif lnExisting == lnSrc {","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/guestagent/fakecloudinit/fakecloudinit_darwin.go#L137-L173","documentation":"Raised by mountFSTabEntry when a syntactically valid 6-field mounts entry uses a filesystem type other than `virtiofs`. On macOS the fake cloud-init only implements virtiofs mounts (as symlinks into /Volumes/My Shared Files); any other fstype is rejected with the offending type and full entry in the message.","triggerScenarios":"A mounts entry with fstype such as `9p`, `ext4`, `nfs`, `tmpfs`, or an empty string reaches mountFSTabEntry's switch default branch.","commonSituations":"Porting user-data from a Linux VM config that used 9p or other native mounts, typos like `virtio-fs` or `VirtioFS` (matching is exact, lowercase `virtiofs` only), or leftover mounts entries from a different hypervisor.","solutions":["Change the fstype field to exactly `virtiofs` (lowercase, no dash).","Share the host directory via Lima's virtiofs sharing so it appears under /Volumes/My Shared Files in the guest.","Remove the mounts entry if the filesystem type is not needed on macOS.","For non-virtiofs filesystems, configure the mount outside user-data (e.g. a boot script in /var/lib/cloud/scripts/per-boot)."],"exampleFix":"// before (user-data)\nmounts:\n  - [\"/Users/foo/share\", \"/mnt/share\", \"9p\", \"ro\", \"0\", \"0\"]\n// after\nmounts:\n  - [\"/Users/foo/share\", \"/mnt/share\", \"virtiofs\", \"ro\", \"0\", \"0\"]","handlingStrategy":"validation","validationCode":"func validateFSType(mounts [][]string) error {\n  for i, m := range mounts {\n    if len(m) == 6 && m[2] != \"virtiofs\" {\n      return fmt.Errorf(\"mounts[%d]: fstype %q unsupported on macOS (only virtiofs)\", i, m[2])\n    }\n  }\n  return nil\n}","typeGuard":"func isVirtiofsEntry(m []string) bool { return len(m) == 6 && m[2] == \"virtiofs\" }","tryCatchPattern":"if err := mountFSTabEntry(m); err != nil {\n  if strings.Contains(err.Error(), \"unsupported filesystem type\") {\n    log.Warnf(\"non-virtiofs mount skipped: %v\", m)\n    continue\n  }\n  return err\n}","preventionTips":["Use exactly the lowercase string `virtiofs` - `virtio-fs` or `VirtioFS` will not match.","Do not copy 9p/ext4/nfs mounts from Linux guest configs into macOS user-data.","Configure non-virtiofs mounts via boot scripts under /var/lib/cloud/scripts/per-boot instead.","Keep a single fstype per guest platform in your templates."],"tags":["macos","cloud-init","mount","virtiofs","unsupported"],"backgroundTag":"unsupported-filesystem-type","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}