{"record":{"id":"66d3f6d0ff1c3e33","repo":"abiosoft/colima","slug":"cannot-use-vmtype-s-error-w","errorCode":null,"errorMessage":"cannot use vmType: '%s', error: %w","messagePattern":"cannot use vmType: '(.+?)', error: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/configmanager/configmanager.go","lineNumber":76,"sourceCode":"\tif _, ok := validMountTypes[c.MountType]; !ok {\n\t\treturn fmt.Errorf(\"invalid mountType: '%s'\", c.MountType)\n\t}\n\tvalidVMTypes := map[string]bool{\"qemu\": true}\n\tif util.MacOS13OrNewer() {\n\t\tvalidVMTypes[\"vz\"] = true\n\t}\n\tif util.MacOS13OrNewerOnArm() {\n\t\tvalidVMTypes[\"krunkit\"] = true\n\t}\n\tif c.VMType == \"krunkit\" && !util.MacOS13OrNewerOnArm() {\n\t\treturn fmt.Errorf(\"vmType 'krunkit' is only available on macOS with Apple Silicon\")\n\t}\n\tif _, ok := validVMTypes[c.VMType]; !ok {\n\t\treturn fmt.Errorf(\"invalid vmType: '%s'\", c.VMType)\n\t}\n\tif c.VMType == \"qemu\" {\n\t\tif err := util.AssertQemuImg(); err != nil {\n\t\t\treturn fmt.Errorf(\"cannot use vmType: '%s', error: %w\", c.VMType, err)\n\t\t}\n\t}\n\tif c.VMType == \"krunkit\" {\n\t\tif err := util.AssertKrunkit(); err != nil {\n\t\t\treturn fmt.Errorf(\"cannot use vmType: '%s', error: %w\", c.VMType, err)\n\t\t}\n\t}\n\n\tif c.DiskImage != \"\" {\n\t\tif strings.HasPrefix(c.DiskImage, \"http://\") || strings.HasPrefix(c.DiskImage, \"https://\") {\n\t\t\treturn fmt.Errorf(\"cannot use diskImage: remote URLs not supported, only local files can be specified\")\n\t\t}\n\t}\n\n\tif _, ok := validPortForwarders[c.PortForwarder]; !ok {\n\t\treturn fmt.Errorf(\"invalid port forwarder: '%s'\", c.PortForwarder)\n\t}\n","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/config/configmanager/configmanager.go#L58-L94","documentation":"When vmType is 'qemu', ValidateConfig calls util.AssertQemuImg() to confirm the qemu-img binary is available on the host. If qemu-img is missing or cannot be executed, the failure is wrapped as 'cannot use vmType: qemu'. qemu-img ships with Lima's QEMU dependency and is required to create and manage the VM disk image.","triggerScenarios":"vmType: qemu while exec.LookPath-style checks for qemu-img fail: Lima not installed (source-built colima without brew), a custom lima without QEMU tooling, or a PATH missing the brew prefix in GUI-launched or service contexts.","commonSituations":"Installing colima from source without 'brew install lima'; running from an IDE terminal or launchd where /opt/homebrew/bin is not in PATH; a brew upgrade that unlinked or removed qemu artifacts.","solutions":["Install Lima with its QEMU dependency: brew install lima (reinstalling colima via brew pulls it automatically)","Verify the binary: qemu-img --version; if it exists but is not found, fix PATH to include the brew bin directory","As a workaround on macOS 13+, switch vmType to 'vz' which does not require qemu-img"],"exampleFix":"# before\nqemu-img: command not found\ncolima start   # cannot use vmType: 'qemu'\n\n# after\nbrew install lima && qemu-img --version && colima start","handlingStrategy":"validation","validationCode":"if c.VMType == \"qemu\" {\n    if _, err := exec.LookPath(\"qemu-img\"); err != nil {\n        // install lima (brew install lima) or fix PATH before starting\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := configmanager.ValidateConfig(c); err != nil {\n    if strings.Contains(err.Error(), \"cannot use vmType\") && c.VMType == \"qemu\" {\n        // qemu-img missing: install lima or switch to 'vz' on macOS 13+\n    }\n}","preventionTips":["Install colima via brew so lima and qemu-img are pulled in together","Verify 'qemu-img --version' works in the exact shell or service context that runs colima","Include the brew bin dir in PATH for launchd/systemd/CI environments"],"tags":["config","validation","qemu","dependencies","path"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}