{"record":{"id":"06f623e30912669b","repo":"lima-vm/lima","slug":"failed-to-mount-fstab-entry-v-w","errorCode":null,"errorMessage":"failed to mount fstab entry %v: %w","messagePattern":"failed to mount fstab entry (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/guestagent/fakecloudinit/fakecloudinit_darwin.go","lineNumber":111,"sourceCode":"\t\treturn fmt.Errorf(\"failed to unmarshal user data YAML: %w\", err)\n\t}\n\n\tvar errs []error\n\tif userData.Growpart != nil {\n\t\tlogrus.Warn(\"growpart is not implemented\")\n\t}\n\tif userData.PackageUpdate {\n\t\tlogrus.Warn(\"package_update is not implemented\")\n\t}\n\tif userData.PackageUpgrade {\n\t\tlogrus.Warn(\"package_upgrade is not implemented\")\n\t}\n\tif userData.PackageRebootIfRequired {\n\t\tlogrus.Warn(\"package_reboot_if_required is not implemented\")\n\t}\n\tfor _, m := range userData.Mounts {\n\t\tif err = mountFSTabEntry(m); err != nil {\n\t\t\terrs = append(errs, fmt.Errorf(\"failed to mount fstab entry %v: %w\", m, err))\n\t\t}\n\t}\n\tif userData.Timezone != \"\" {\n\t\tif err = setTimezone(ctx, userData.Timezone); err != nil {\n\t\t\terrs = append(errs, fmt.Errorf(\"failed to set timezone: %w\", err))\n\t\t}\n\t}\n\tfor _, u := range userData.Users {\n\t\tif err := createUser(ctx, &u); err != nil {\n\t\t\terrs = append(errs, fmt.Errorf(\"failed to create user %#q: %w\", u.Name, err))\n\t\t}\n\t}\n\tfor _, entry := range userData.WriteFiles {\n\t\tif err := writeFiles(ctx, entry); err != nil {\n\t\t\terrs = append(errs, fmt.Errorf(\"failed to write file for path %#q: %w\", entry.Path, err))\n\t\t}\n\t}\n\tif userData.ManageResolvConf && userData.ResolvConf != nil {","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/guestagent/fakecloudinit/fakecloudinit_darwin.go#L93-L129","documentation":"Raised by processUserData in the fakecloudinit guest agent (macOS) when one mounts entry from the cloud-init user-data cannot be mounted. It wraps the specific underlying error from mountFSTabEntry, which validates the fstab entry format and performs the mount (virtiofs only). The original entry is included in the message for diagnosis.","triggerScenarios":"A `mounts:` entry in the user-data cloud-config fails mountFSTabEntry: the entry does not have exactly 6 fields, its fstype is not `virtiofs`, the virtiofs pseudo tag contains a path separator, or creating/verifying the /Volumes symlink fails.","commonSituations":"Copying a Linux-style fstab line with fewer than 6 columns (e.g. omitting dump/passno), using an fstype like `9p` or `nfs` that the macOS fake cloud-init does not implement, or a destination directory that already exists as a non-symlink or points elsewhere.","solutions":["Inspect the wrapped error in the message; it states exactly which sub-step failed (field count, fs type, pseudo tag, or symlink).","Fix the mounts entry in the Lima YAML / user-data so it has exactly 6 fields: <src> <dst> <fstype> <opts> <dump> <passno>.","Use only `virtiofs` as the fstype on macOS; other filesystem types are unsupported by the fake cloud-init.","Ensure the destination dir does not already exist as a real file/directory, or is already a symlink pointing to /Volumes/My Shared Files/<tag>.","Remove or comment out mounts entries that are not needed for the instance to boot."],"exampleFix":"// before (user-data mounts)\nmounts:\n  - [\"/Users/foo/share\", \"/mnt/share\", \"9p\"]\n// after\nmounts:\n  - [\"/Users/foo/share\", \"/mnt/share\", \"virtiofs\", \"ro\", \"0\", \"0\"]","handlingStrategy":"validation","validationCode":"func validateMounts(mounts [][]string) error {\n  for i, m := range mounts {\n    if len(m) != 6 { return fmt.Errorf(\"mounts[%d]: need 6 fields, got %d\", i, len(m)) }\n    if m[2] != \"virtiofs\" { return fmt.Errorf(\"mounts[%d]: fstype %q unsupported on macOS\", i, m[2]) }\n    if strings.Contains(m[0], \"/\") { return fmt.Errorf(\"mounts[%d]: pseudo tag %q must not contain separators\", i, m[0]) }\n  }\n  return nil\n}","typeGuard":"func isValidFSTabEntry(m []string) bool {\n  return len(m) == 6 && m[2] == \"virtiofs\" && !strings.Contains(m[0], string(filepath.Separator))\n}","tryCatchPattern":"if err := processUserData(ctx, mnt); err != nil {\n  var entryErr *fstabError\n  if errors.As(err, &entryErr) { /* inspect which mounts entry failed and skip/fix it */ }\n}","preventionTips":["Always write mounts entries with exactly 6 columns including the trailing `0 0`.","Use only `virtiofs` fstype on macOS guests.","Keep pseudo tags as single path components.","Lint user-data cloud-config YAML before embedding it in cidata.iso."],"tags":["macos","cloud-init","mount","virtiofs"],"backgroundTag":"mount-fstab-entry-failed","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}