{"record":{"id":"f26373d9c9e7dada","repo":"lima-vm/lima","slug":"field-mounts-d-mountpoint-is-the-reserved-inte","errorCode":null,"errorMessage":"field `mounts[%d].mountPoint` is the reserved internal home directory %#q","messagePattern":"field `mounts\\[(.+?)\\]\\.mountPoint` is the reserved internal home directory %#q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/limayaml/validate.go","lineNumber":151,"sourceCode":"\t\t}\n\t\tst, err := os.Stat(loc)\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, os.ErrNotExist) {\n\t\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `mounts[%d].location` refers to an inaccessible path: %#q: %w\", i, f.Location, err))\n\t\t\t}\n\t\t\tif warn {\n\t\t\t\tlogrus.Warnf(\"field `mounts[%d].location` refers to a non-existent directory: %#q:\", i, f.Location)\n\t\t\t}\n\t\t} else if !st.IsDir() {\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `mounts[%d].location` refers to a non-directory path: %#q: %w\", i, f.Location, err))\n\t\t}\n\n\t\tswitch *f.MountPoint {\n\t\tcase \"/\", \"/bin\", \"/dev\", \"/etc\", \"/home\", \"/opt\", \"/sbin\", \"/tmp\", \"/usr\", \"/var\":\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `mounts[%d].mountPoint` must not be a system path such as /etc or /usr\", i))\n\t\t// home directory defined in \"cidata.iso:/user-data\"\n\t\tcase *y.User.Home:\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `mounts[%d].mountPoint` is the reserved internal home directory %#q\", i, *y.User.Home))\n\t\t}\n\t\t// There is no tilde-expansion for guest filenames\n\t\tif strings.HasPrefix(*f.MountPoint, \"~\") {\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `mounts[%d].mountPoint` must not start with `~`\", i))\n\t\t}\n\n\t\tif _, err := units.RAMInBytes(*f.NineP.Msize); err != nil {\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `msize` has an invalid value: %w\", err))\n\t\t}\n\t}\n\n\tif *y.SSH.LocalPort != 0 {\n\t\tif err := validatePort(\"ssh.localPort\", *y.SSH.LocalPort); err != nil {\n\t\t\terrs = errors.Join(errs, err)\n\t\t}\n\t}\n\n\tif y.MountType != nil {","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/limayaml/validate.go#L133-L169","documentation":"The guest user's home directory (defined via cidata user-data, `y.User.Home`) is reserved; mounting anything over it would shadow the guest's home (dotfiles, ssh keys, provisioning). Validate() rejects a mountPoint exactly equal to it.","triggerScenarios":"A mounts entry's mountPoint equals the guest user home path (typically `/home/<user>.linux`) when Validate runs.","commonSituations":"Assuming mountPoint `~` or `/home/username` maps to the guest home and writing it explicitly; copying mounts from a setup with a different guest username where the path collided.","solutions":["Set mountPoint to a subdirectory of home, e.g. `/home/<user>.linux/data`, or a non-home path like `/mnt/host`","Remove the explicit mountPoint if a default is acceptable","Re-validate the template after adjusting"],"exampleFix":"// before\nmounts:\n  - location: ~/data\n    mountPoint: /home/user.linux\n// after\nmounts:\n  - location: ~/data\n    mountPoint: /home/user.linux/data","handlingStrategy":"validation","validationCode":"function notGuestHome(mp, guestHome) { return typeof mp === 'string' && mp !== guestHome } // guestHome is typically /home/<user>.linux","typeGuard":null,"tryCatchPattern":"try { await limactl(['template','validate', file]) } catch (e) { if (/reserved internal home directory/.test(e.message)) { nestUnderHome(e.message); } else throw e }","preventionTips":["Never mount directly over the guest user's home; use a subdirectory","Check the resolved guest home in the instance after first start","Document guest home path for the team's shared templates"],"tags":["lima","config-validation","mounts"],"backgroundTag":"reserved-mount-point","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}