lima-vm/lima · error

field `mountType` must be %#q for QEMU driver on Windows, go

Error message

field `mountType` must be %#q for QEMU driver on Windows, got %#q

What it means

Validation error from the QEMU driver on Windows: the instance's `mountType` field has a value that is not allowed for QEMU on Windows (expected value printed in the first %#q). Typically 9p, which is unsupported on Windows hosts.

Source

Thrown at pkg/driver/qemu/qemu_driver.go:176

				return nil
			default:
				return 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)
			}
		case "darwin":
			switch *cfg.MountType {
			case limatype.REVSSHFS, limatype.NINEP:
				return nil
			default:
				return fmt.Errorf("field `mountType` must be %#q or %#q for QEMU driver on macOS, got %#q", limatype.REVSSHFS, limatype.NINEP, *cfg.MountType)
			}
		case "windows":
			// Windows version of QEMU does not support 9p yet, so we should not suggest it.
			// https://gitlab.com/qemu-project/qemu/-/work_items/974
			switch *cfg.MountType {
			case limatype.REVSSHFS:
				return nil
			default:
				return fmt.Errorf("field `mountType` must be %#q for QEMU driver on Windows, got %#q", limatype.REVSSHFS, *cfg.MountType)
			}
		default:
			switch *cfg.MountType {
			case limatype.REVSSHFS, limatype.NINEP:
				return nil
			default:
				return fmt.Errorf("field `mountType` must be %#q or %#q for QEMU driver on %s, got %#q", limatype.REVSSHFS, limatype.NINEP, runtime.GOOS, *cfg.MountType)
			}
		}
	}

	return nil
}

func fillConfig(cfg *limatype.LimaYAML, instDir string) error {
	if cfg.VMType == nil {
		cfg.VMType = new(limatype.QEMU)
	}

View on GitHub (pinned to dd909d0973)

Solutions

  1. Set mountType to the value shown as required in the error (e.g. "reverse-sshfs")
  2. Use a template that defaults to a Windows-compatible mount type

Example fix

# before
mountType: 9p
// after
mountType: revsshfs
Defensive patterns

Strategy: validation

Validate before calling

if cfg.MountType != nil && *cfg.MountType != limatype.REVSSHFS {
    return fmt.Errorf("on Windows the QEMU driver only supports mountType: revsshfs")
}

Type guard

func validWindowsMountType(mt limatype.MountType) bool { return mt == limatype.REVSSHFS }

Try / catch

if err := drv.Validate(ctx); err != nil && strings.Contains(err.Error(), "on Windows") {
    // set mountType: revsshfs in lima.yaml and re-validate
}

Prevention

When it happens

Trigger: lima.yaml with `mountType: 9p` or `mountType: virtiofs` (or any non-revsshfs value) while using the QEMU driver on a Windows host.

Common situations: Sharing one lima.yaml across macOS/Linux/Windows contributors where the Linux/macOS-valid value (9p or virtiofs) is invalid on Windows; copying docs examples written for Linux.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01). Data as JSON: /api/errors/c1aaf09ad71ce3f8. Report an issue: GitHub.