{"record":{"id":"2d5b1d9fcc1a5c7c","repo":"lima-vm/lima","slug":"unknown-or-unsupported-vm-type-s","errorCode":null,"errorMessage":"unknown or unsupported VM type: %s","messagePattern":"unknown or unsupported VM type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/driverutil/instance.go","lineNumber":25,"sourceCode":"\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/sirupsen/logrus\"\n\n\t\"github.com/lima-vm/lima/v2/pkg/driver\"\n\t\"github.com/lima-vm/lima/v2/pkg/driver/external/server\"\n\t\"github.com/lima-vm/lima/v2/pkg/limatype\"\n\t\"github.com/lima-vm/lima/v2/pkg/registry\"\n)\n\n// CreateConfiguredDriver creates a driver.ConfiguredDriver for the given instance.\n// For external drivers, it reuses an existing server if one is already running,\n// or starts a new one if needed.\nfunc CreateConfiguredDriver(ctx context.Context, inst *limatype.Instance, sshLocalPort int) (*driver.ConfiguredDriver, error) {\n\tlimaDriver := inst.Config.VMType\n\textDriver, intDriver, exists := registry.Get(*limaDriver)\n\tif !exists {\n\t\treturn nil, fmt.Errorf(\"unknown or unsupported VM type: %s\", *limaDriver)\n\t}\n\tvar driverInfo driver.Info\n\tif extDriver != nil {\n\t\textDriver.Logger.Debugf(\"Connecting to external driver %#q for %#q\", extDriver.Name, inst.Name)\n\t\tif err := server.Start(ctx, extDriver, inst.Name); err != nil {\n\t\t\textDriver.Logger.Errorf(\"Failed to start external driver %#q: %v\", extDriver.Name, err)\n\t\t\treturn nil, err\n\t\t}\n\n\t\tdriverInfo = extDriver.Client.Info(ctx)\n\t\tif !driverInfo.Features.StaticSSHPort {\n\t\t\tinst.SSHLocalPort = sshLocalPort\n\t\t}\n\t\treturn extDriver.Client.Configure(ctx, inst)\n\t}\n\n\tdriverInfo = intDriver.Info(ctx)\n\tlogrus.Debugf(\"Using internal driver %q\", driverInfo.Name)","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/driverutil/instance.go#L7-L43","documentation":"CreateConfiguredDriver looks up the instance's configured VM type in the driver registry and fails when no external or internal driver is registered under that name. This means the lima.yaml vmType is either misspelled, from a newer Lima version, or provided by an external driver binary that is not installed/discoverable.","triggerScenarios":"Calling CreateConfiguredDriver (directly or via limactl start/restart/edit/factory-reset/clone/rename) for an instance whose inst.Config.VMType is not in limatype.VMTypes and not found by registry.Get — e.g. vmType set to an unknown string or an external driver plugin missing from PATH/registry.","commonSituations":"Typo in vmType (e.g. \"qemu\" vs \"qemu35\"); config written by a newer Lima with a driver this build does not know; external driver plugin not installed or not registered at startup; hand-edited lima.yaml.","solutions":["Run `limactl edit <instance>` and set vmType to a supported built-in value (qemu, vz, wsl2, etc.)","Install/register the external driver binary that provides the missing VM type and restart limactl","Upgrade Lima to a version that knows the vmType in the config","Inspect the instance's lima.yaml under ~/.lima/<instance>/lima.yaml and correct the vmType field manually"],"exampleFix":"// before: lima.yaml\nvmType: \"kvm2\" // unknown\n// after\nvmType: \"qemu\"","handlingStrategy":"validation","validationCode":"vmType := \"qemu\"\nif !slices.Contains(limatype.VMTypes, vmType) {\n    if _, _, ok := registry.Get(vmType); !ok {\n        return fmt.Errorf(\"vmType %q unsupported before start\", vmType)\n    }\n}","typeGuard":"func isKnownVMType(t string) bool {\n    if slices.Contains(limatype.VMTypes, t) {\n        return true\n    }\n    _, _, ok := registry.Get(t)\n    return ok\n}","tryCatchPattern":"if _, err := driverutil.CreateConfiguredDriver(ctx, inst, sshPort); err != nil {\n    if strings.HasPrefix(err.Error(), \"unknown or unsupported VM type\") {\n        // fall back to default driver or prompt to fix config\n    }\n    return err\n}","preventionTips":["Only set vmType to documented values; prefer omitting it and letting Lima default","Keep templates and limactl from the same release","Install external drivers before creating instances that reference them"],"tags":["configuration","driver-registry","vmtype"],"backgroundTag":"unknown-vm-type","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}