{"record":{"id":"dc028103d564daaf","repo":"lima-vm/lima","slug":"field-mounttype-must-be-one-of-v-for-qemu-drive","errorCode":null,"errorMessage":"field `mountType` must be one of %v for QEMU driver on Linux, got %#q","messagePattern":"field `mountType` must be one of (.+?) for QEMU driver on Linux, got %#q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/driver/qemu/qemu_driver.go","lineNumber":160,"sourceCode":"\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)\n\t\t\t}\n\t\tcase \"windows\":\n\t\t\t// Windows version of QEMU does not support 9p yet, so we should not suggest it.\n\t\t\t// https://gitlab.com/qemu-project/qemu/-/work_items/974\n\t\t\tswitch *cfg.MountType {\n\t\t\tcase limatype.REVSSHFS:\n\t\t\t\treturn nil\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"field `mountType` must be %#q for QEMU driver on Windows, got %#q\", limatype.REVSSHFS, *cfg.MountType)\n\t\t\t}\n\t\tdefault:","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/driver/qemu/qemu_driver.go#L142-L178","documentation":"On Linux, the QEMU driver only supports revsshfs, 9p, and virtiofs as mountType. Any other value (e.g. reverse-sshfs misspelled, or a mount type valid only for other drivers like vz on macOS) fails validation with the allowed list and the offending value.","triggerScenarios":"lima.yaml with `mountType:` set to something other than revsshfs/9p/virtiofs while using the QEMU driver on a Linux host — e.g. `mountType: virtiofs-exporter`, `mountType: vz`, `mountType: native`.","commonSituations":"Copying a config written for the VZ driver on macOS to a Linux QEMU setup; typos like `9pv` or `virtio-fs`; older Lima mount type names removed in newer versions.","solutions":["Set `mountType` to one of: revsshfs, 9p, virtiofs (exact strings, e.g. `mountType: virtiofs`).","Remove the `mountType` field to use the default for the QEMU driver.","If you need a mount type from another driver, switch drivers (e.g. vz on macOS) instead."],"exampleFix":"# before\nmountType: virtio-fs\n// after\nmountType: virtiofs","handlingStrategy":"validation","validationCode":"allowed := []string{\"revsshfs\", \"9p\", \"virtiofs\"}\nif cfg.MountType != nil && !slices.Contains(allowed, string(*cfg.MountType)) {\n    return fmt.Errorf(\"mountType %q invalid for QEMU on linux; use one of %v\", *cfg.MountType, allowed)\n}","typeGuard":"func validLinuxMountType(mt limatype.MountType) bool {\n    switch mt {\n    case limatype.REVSSHFS, limatype.NINEP, limatype.VIRTIOFS:\n        return true\n    }\n    return false\n}","tryCatchPattern":"if err := drv.Validate(ctx); err != nil && strings.Contains(err.Error(), \"must be one of\") && strings.Contains(err.Error(), \"Linux\") {\n    // correct mountType in lima.yaml and re-validate\n}","preventionTips":["Use exact strings: revsshfs, 9p, virtiofs.","Don't reuse macOS VZ-driver configs (vz mount types) with QEMU on Linux.","Run `limactl validate` on every config before `limactl start`."],"tags":["qemu","mount","linux","validation"],"backgroundTag":"invalid-config-value","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}