{"record":{"id":"9f3ac5dc6f0d9fe3","repo":"lima-vm/lima","slug":"mount-type-q-is-explicitly-unsupported","errorCode":null,"errorMessage":"mount type %#q is explicitly unsupported","messagePattern":"mount type %#q is explicitly unsupported","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/driver/qemu/qemu_driver.go","lineNumber":149,"sourceCode":"// Helper method for checking the binary signature on macOS.\nfunc validateArch(ctx context.Context, cfg *limatype.LimaYAML) error {\n\tif runtime.GOOS == \"darwin\" {\n\t\tvar vmArch string\n\t\tif cfg.Arch != nil {\n\t\t\tvmArch = *cfg.Arch\n\t\t}\n\t\tif err := checkBinarySignature(ctx, vmArch); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// Helper method for mount type validation.\nfunc validateMountType(cfg *limatype.LimaYAML) error {\n\t// 1. First, check if the user explicitly blocked this mount type in their config.\n\tif cfg.MountTypesUnsupported != nil && cfg.MountType != nil && slices.Contains(cfg.MountTypesUnsupported, *cfg.MountType) {\n\t\treturn fmt.Errorf(\"mount type %#q is explicitly unsupported\", *cfg.MountType)\n\t}\n\n\t// 2. Then, check if the mount type is valid for the current Operating System.\n\tif cfg.MountType != nil {\n\t\tswitch runtime.GOOS {\n\t\tcase \"linux\":\n\t\t\tswitch *cfg.MountType {\n\t\t\tcase limatype.REVSSHFS, limatype.NINEP, limatype.VIRTIOFS:\n\t\t\t\treturn nil\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"field `mountType` must be one of %v for QEMU driver on Linux, got %#q\", []string{limatype.REVSSHFS, limatype.NINEP, limatype.VIRTIOFS}, *cfg.MountType)\n\t\t\t}\n\t\tcase \"darwin\":\n\t\t\tswitch *cfg.MountType {\n\t\t\tcase limatype.REVSSHFS, limatype.NINEP:\n\t\t\t\treturn nil\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"field `mountType` must be %#q or %#q for QEMU driver on macOS, got %#q\", limatype.REVSSHFS, limatype.NINEP, *cfg.MountType)","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/driver/qemu/qemu_driver.go#L131-L167","documentation":"validateMountType() first checks the user's own deny-list: if `mountTypesUnsupported` in lima.yaml contains the currently configured `mountType`, the config directly contradicts itself, so validation fails. This fires before any per-OS compatibility checks.","triggerScenarios":"lima.yaml containing both `mountType: virtiofs` and `mountTypesUnsupported: [virtiofs]` (or any mountType listed in mountTypesUnsupported), for the QEMU driver.","commonSituations":"Template inheritance/composition where an included template disables a mount type the base template sets; hand-edited configs that added a mount type to the unsupported list after choosing it as the active type.","solutions":["Remove the active mountType from the `mountTypesUnsupported` list in lima.yaml.","Or change `mountType` to a value not listed in `mountTypesUnsupported`.","If using template inheritance, check which layer sets each field and reconcile them."],"exampleFix":"# before\nmountType: virtiofs\nmountTypesUnsupported:\n  - virtiofs\n// after\nmountType: virtiofs\nmountTypesUnsupported: []","handlingStrategy":"validation","validationCode":"if cfg.MountType != nil && slices.Contains(cfg.MountTypesUnsupported, *cfg.MountType) {\n    return fmt.Errorf(\"mountType %s conflicts with mountTypesUnsupported deny-list\", *cfg.MountType)\n}","typeGuard":"func mountTypeAllowed(cfg *limatype.LimaYAML) bool {\n    return cfg.MountType == nil || !slices.Contains(cfg.MountTypesUnsupported, *cfg.MountType)\n}","tryCatchPattern":"if err := drv.Validate(ctx); err != nil && strings.Contains(err.Error(), \"explicitly unsupported\") {\n    // reconcile mountType vs mountTypesUnsupported in the YAML, then retry\n}","preventionTips":["Check both `mountType` and `mountTypesUnsupported` together when editing configs.","When extending templates, verify inherited deny-lists don't conflict with base values.","Keep `mountTypesUnsupported` empty unless you have a specific reason."],"tags":["qemu","mount","config-conflict","validation"],"backgroundTag":"config-conflict","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}