{"record":{"id":"36cca2861a4637fc","repo":"lima-vm/lima","slug":"field-mounttype-must-be-q-or-q-for-qemu-driv-36cca2","errorCode":null,"errorMessage":"field `mountType` must be %#q or %#q for QEMU driver on %s, got %#q","messagePattern":"field `mountType` must be %#q or %#q for QEMU driver on (.+?), got %#q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/driver/qemu/qemu_driver.go","lineNumber":183,"sourceCode":"\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:\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 %s, got %#q\", limatype.REVSSHFS, limatype.NINEP, runtime.GOOS, *cfg.MountType)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc fillConfig(cfg *limatype.LimaYAML, instDir string) error {\n\tif cfg.VMType == nil {\n\t\tcfg.VMType = new(limatype.QEMU)\n\t}\n\n\tif cfg.Video.VNC.Display == nil || *cfg.Video.VNC.Display == \"\" {\n\t\tcfg.Video.VNC.Display = new(\"127.0.0.1:0,to=9\")\n\t}\n\n\tvar qemuOpts limatype.QEMUOpts\n\tif err := limayaml.Convert(cfg.VMOpts[limatype.QEMU], &qemuOpts, \"vmOpts.qemu\"); err != nil {","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/driver/qemu/qemu_driver.go#L165-L201","documentation":"Catch-all branch of validateMountType(): for any GOOS other than linux/darwin/windows (e.g. freebsd), the QEMU driver allows only revsshfs and 9p. The error names the OS via runtime.GOOS, the two allowed values, and the offending value.","triggerScenarios":"Running limactl with the QEMU driver on a non-linux/darwin/windows host with `mountType:` set to anything other than revsshfs or 9p (e.g. virtiofs).","commonSituations":"Experimental Lima setups on FreeBSD or other Unix-likes; configs copied from Linux where virtiofs was allowed.","solutions":["Set `mountType` to `revsshfs` or `9p` in lima.yaml.","Remove the `mountType` field to use the platform default.","Recognize that virtiofs is not supported under QEMU on this OS; choose 9p or revsshfs."],"exampleFix":"# before\nmountType: virtiofs\n// after\nmountType: 9p","handlingStrategy":"validation","validationCode":"allowed := []string{\"revsshfs\", \"9p\"}\nif cfg.MountType != nil && !slices.Contains(allowed, string(*cfg.MountType)) {\n    return fmt.Errorf(\"mountType %q invalid for QEMU on %s; use one of %v\", *cfg.MountType, runtime.GOOS, allowed)\n}","typeGuard":"func validOtherOSMountType(mt limatype.MountType) bool {\n    return mt == limatype.REVSSHFS || mt == limatype.NINEP\n}","tryCatchPattern":"if err := drv.Validate(ctx); err != nil && strings.Contains(err.Error(), \"QEMU driver on\") {\n    // set mountType to revsshfs or 9p for this platform and re-validate\n}","preventionTips":["On non-Linux/macOS/Windows hosts, restrict mountType to revsshfs or 9p.","Avoid copying Linux configs (virtiofs) to other Unix platforms.","Always run `limactl validate` on the actual host OS before starting."],"tags":["qemu","mount","validation","platform"],"backgroundTag":"invalid-config-value","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}