{"record":{"id":"3e31949d7c930925","repo":"lima-vm/lima","slug":"failed-to-get-iso-label-w","errorCode":null,"errorMessage":"failed to get ISO label: %w","messagePattern":"failed to get ISO label: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cidata/template.go","lineNumber":159,"sourceCode":"\nfunc (t *TemplateArgs) generateWindowsInitialPassword() error {\n\tconst pwLen = 16\n\t// Avoid special characters to minimize potential keyboard layout issue.\n\tpw, err := password.Generate(pwLen, pwLen/4, 0, false, false)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to generate password: %w\", err)\n\t}\n\n\tt.WindowsInitialPassword = pw\n\treturn nil\n}\n\n// checkWindowsVersion checks if a guest VM is Windows 11 (true) or Windows server 2025 (false).\nfunc (t *TemplateArgs) checkWindowsVersion(instDir string) error {\n\timagePath := filepath.Join(instDir, filenames.ISO)\n\tlabel, err := iso9660util.Label(imagePath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get ISO label: %w\", err)\n\t}\n\n\tt.IsWindowsServer = !strings.HasPrefix(label, windowsClientISOLabelPrefix)\n\n\treturn nil\n}\n\nfunc ValidateTemplateArgs(args *TemplateArgs) error {\n\tif err := identifiers.Validate(args.Name); err != nil {\n\t\treturn err\n\t}\n\t// args.User is intentionally not validated here; the user can override with any name they want\n\t// limayaml.FillDefault will validate the default (local) username, but not an explicit setting\n\tif args.User == \"root\" {\n\t\treturn errors.New(\"field User must not be `root`\")\n\t}\n\tif args.UID == 0 {\n\t\treturn errors.New(\"field UID must not be 0\")","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/cidata/template.go#L141-L177","documentation":"checkWindowsVersion (pkg/cidata/template.go:159) reads the ISO label of the previously downloaded Windows ISO (instDir/<ISO>) with iso9660util.Label to distinguish Windows 11 from Windows Server. If the label cannot be read - file missing, not a valid ISO9660 image, or IO error - it wraps the error and template generation aborts.","triggerScenarios":"`limactl start` on a Windows instance when the ISO file is absent from the instance directory, the download was incomplete/corrupted, or the file is not a valid ISO9660 image.","commonSituations":"Interrupted ISO download, manually deleted instance ISO, or pointing at a partially-written file after a failed/canceled `limactl start`.","solutions":["Check the ISO exists in the instance directory (~/.lima/<instance>/data-disk.iso or filenames.ISO path)","Delete the instance and recreate (`limactl delete` then `limactl start`) to re-download the ISO","Verify the downloaded file is a complete ISO (checksum, size)"],"exampleFix":"// before (partial download)\n$ limactl start windows-instance  # ISO truncated -> Label() fails\n// after\n$ limactl delete windows-instance\n$ limactl start template://experimental/windows-11","handlingStrategy":"try-catch","validationCode":"isoPath := filepath.Join(instDir, \"data-disk.iso\") // filenames.ISO\nif _, err := os.Stat(isoPath); err != nil {\n    return fmt.Errorf(\"Windows ISO missing, re-download required: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"err := limactl.Start(ctx, instName)\nif err != nil && strings.Contains(err.Error(), \"failed to get ISO label\") {\n    log.Printf(\"ISO unreadable - delete instance and re-download: %v\", err)\n    // limactl delete <inst> && limactl start again\n}","preventionTips":["Never cancel `limactl start` mid ISO download; re-create the instance if interrupted","Check the ISO file exists and has a plausible size before starting a Windows instance","Use checksum verification for manually downloaded Windows ISOs"],"tags":["windows","iso","file-io"],"backgroundTag":"iso-label-read-failed","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}