{"record":{"id":"145589d81e21b788","repo":"lima-vm/lima","slug":"field-images-must-be-set","errorCode":null,"errorMessage":"field `images` must be set","messagePattern":"field `images` must be set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"pkg/limayaml/validate.go","lineNumber":79,"sourceCode":"\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}\n\n\tif len(y.Images) == 0 {\n\t\terrs = errors.Join(errs, errors.New(\"field `images` must be set\"))\n\t}\n\tfor i, f := range y.Images {\n\t\terr := validateFileObject(f.File, fmt.Sprintf(\"images[%d]\", i))\n\t\tif err != nil {\n\t\t\terrs = errors.Join(errs, err)\n\t\t}\n\t\tif f.Kernel != nil {\n\t\t\terr := validateFileObject(f.Kernel.File, fmt.Sprintf(\"images[%d].kernel\", i))\n\t\t\tif err != nil {\n\t\t\t\terrs = errors.Join(errs, err)\n\t\t\t}\n\t\t\tif f.Kernel.Arch != f.Arch {\n\t\t\t\terrs = errors.Join(errs, fmt.Errorf(\"images[%d].kernel has unexpected architecture %#q, must be %#q\", i, f.Kernel.Arch, f.Arch))\n\t\t\t}\n\t\t}\n\t\tif f.Initrd != nil {\n\t\t\terr := validateFileObject(*f.Initrd, fmt.Sprintf(\"images[%d].initrd\", i))\n\t\t\tif err != nil {","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/limayaml/validate.go#L61-L97","documentation":"The `images` field is empty after defaults are applied, so there is no disk image to boot the instance from.","triggerScenarios":"Template with no `images:` entries, images stripped during editing, or images conditional on an arch/OS that filtered out every entry for the current host.","commonSituations":"Minimal hand-written templates missing images; copying only the non-images part of a template; arch-specific image list not matching the chosen `arch`.","solutions":["Add an `images` entry with a valid `location` (ISO or disk image URL/path) and matching `arch`","Start from an existing template (e.g. templates/default.yaml) that includes images","Ensure image entries' arch matches the instance `arch` so at least one applies"],"exampleFix":"// before\nimages: []\n// after\nimages:\n- location: https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img\n  arch: x86_64","handlingStrategy":"validation","validationCode":"func hasBootableImage(y *limatype.LimaYAML, arch string) bool {\n\tfor _, img := range y.Images {\n\t\tif string(img.Arch) == arch {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}","typeGuard":"func hasImages(y *limatype.LimaYAML) bool {\n\treturn y != nil && len(y.Images) > 0\n}","tryCatchPattern":"if err := limayaml.Validate(y, false); err != nil {\n\tif strings.Contains(err.Error(), \"field `images` must be set\") {\n\t\treturn fmt.Errorf(\"template has no bootable image: %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Always include at least one images[] entry matching the target arch","Derive new templates from templates/default.yaml instead of writing from scratch","Keep arch-conditional image lists in sync with the chosen arch"],"tags":["lima","images","config-validation"],"backgroundTag":"missing-required-argument","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}