{"record":{"id":"90c08d6bef656db0","repo":"lima-vm/lima","slug":"currently-windows-guest-is-only-supported-on-q-90c08d","errorCode":null,"errorMessage":"currently Windows guest is only supported on [%#q, %#q]; got %#q","messagePattern":"currently Windows guest is only supported on \\[%#q, %#q\\]; got %#q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/limayaml/validate.go","lineNumber":58,"sourceCode":"\tif y.MinimumLimaVersion != nil {\n\t\tif _, err := versionutil.Parse(*y.MinimumLimaVersion); err != nil {\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `minimumLimaVersion` must be a semvar value, got %#q: %w\", *y.MinimumLimaVersion, err))\n\t\t}\n\t\t// Unparsable version.Version (like commit hashes or \"<unknown>\") is treated as \"latest/greatest\"\n\t\t// and will pass all version comparisons, allowing development builds to work.\n\t\tif !versionutil.GreaterEqual(version.Version, *y.MinimumLimaVersion) {\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"template requires Lima version %#q; this is only %#q\", *y.MinimumLimaVersion, version.Version))\n\t\t}\n\t}\n\n\tswitch *y.OS {\n\tcase limatype.LINUX, limatype.DARWIN, limatype.FREEBSD:\n\tcase limatype.WINDOWS:\n\t\tif *y.VMType != limatype.QEMU {\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"currently Windows guest is only supported on %#q; got %#q\", limatype.QEMU, *y.VMType))\n\t\t}\n\t\tif !slices.Contains([]limatype.Arch{limatype.X8664, limatype.AARCH64}, *y.Arch) {\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"currently Windows guest is only supported on [%#q, %#q]; got %#q\", limatype.X8664, limatype.AARCH64, *y.Arch))\n\t\t}\n\tdefault:\n\t\terrs = errors.Join(errs, fmt.Errorf(\"field `os` must be one of %#q; got %#q\", limatype.OSTypes, *y.OS))\n\t}\n\tif !slices.Contains(limatype.ArchTypes, *y.Arch) {\n\t\terrs = errors.Join(errs, fmt.Errorf(\"field `arch` must be one of %v; got %#q\", limatype.ArchTypes, *y.Arch))\n\t}\n\n\tif y.User.Shell != nil {\n\t\tshell := *y.User.Shell\n\t\tif *y.OS == limatype.WINDOWS {\n\t\t\tif !IsSupportedWindowsShell(shell) {\n\t\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `user.shell` must be one of %v for Windows guest, got %#q\", SupportedWindowsShells, shell))\n\t\t\t}\n\t\t} else if !path.IsAbs(shell) {\n\t\t\terrs = errors.Join(errs, fmt.Errorf(\"field `user.shell` must be an absolute path, got %#q\", shell))\n\t\t}\n\t}","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/limayaml/validate.go#L40-L76","documentation":"Lima validates the `os` field of a lima.yaml template against the set of supported guest operating systems. When `os: windows` is selected, Windows guests are currently only supported by the QEMU driver and only on x86_64 or aarch64 architectures; any other VM type triggers this error. It is thrown during Validate(), which runs on every create, edit, restart, and template validation action.","triggerScenarios":"A template sets `os: windows` while `vmType` is something other than \"qemu\" (e.g. vz, vz-rosa, wsl2), and Validate() is invoked via limactl create/edit/restart/start or template validation.","commonSituations":"Users copy a vz-based macOS template and change os to windows; users on Apple Silicon try vz with a Windows guest; templates hand-edited for experimentation.","solutions":["Change `vmType` to `qemu` in the template","Remove the `os: windows` override to use the default Linux guest with the preferred driver","Use a template designed for Windows guests under QEMU"],"exampleFix":"// before\nos: windows\nvmType: vz\n// after\nos: windows\nvmType: qemu","handlingStrategy":"validation","validationCode":"func validWindowsVMType(os, vmType, arch string) bool {\n\tif os != \"windows\" {\n\t\treturn true\n\t}\n\treturn vmType == \"qemu\" && (arch == \"x86_64\" || arch == \"aarch64\")\n}","typeGuard":"func isWindowsCompatible(y *limatype.LimaYAML) bool {\n\treturn *y.OS != limatype.WINDOWS || *y.VMType == limatype.QEMU\n}","tryCatchPattern":"if err := limayaml.Validate(y, false); err != nil {\n\tif strings.Contains(err.Error(), \"Windows guest is only supported\") {\n\t\t// fix vmType to qemu before proceeding\n\t}\n\treturn err\n}","preventionTips":["Always pair os: windows with vmType: qemu in templates","Run limactl template validate after editing os or vmType","Start from an official Windows-capable template"],"tags":["lima","windows-guest","vmtype","config-validation"],"backgroundTag":"unsupported-driver-os-combination","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}