{"record":{"id":"7b0ec0aa466b1a49","repo":"lima-vm/lima","slug":"failed-to-get-boot-scripts-w","errorCode":null,"errorMessage":"failed to get boot scripts: %w","messagePattern":"failed to get boot scripts: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cidata/cidata.go","lineNumber":415,"sourceCode":"// in instDir. It returns the instance ID, which changes on every boot.\nfunc GenerateISO9660(ctx context.Context, drv driver.Driver, instDir, name string, instConfig *limatype.LimaYAML, udpDNSLocalPort, tcpDNSLocalPort int, guestAgentBinary, nerdctlArchive string, vsockPort int, virtioPort string, noCloudInit, rosettaEnabled, rosettaBinFmt bool) (string, error) {\n\targs, err := templateArgs(ctx, true, instDir, name, instConfig, udpDNSLocalPort, tcpDNSLocalPort, vsockPort, virtioPort, noCloudInit, rosettaEnabled, rosettaBinFmt)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif err := ValidateTemplateArgs(args); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tlayout, err := ExecuteTemplateCIDataISO(args)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tdriverScripts, err := drv.BootScripts(ctx)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to get boot scripts: %w\", err)\n\t}\n\n\tfor filename, content := range driverScripts {\n\t\tlayoutPath := path.Join(\"boot.Linux\", filename)\n\t\tif strings.Contains(filename, \"/\") {\n\t\t\t// When the filename contains a slash, it must be in the format of \"boot.<OS>/<SCRIPT>\"\n\t\t\tif !strings.HasPrefix(filename, \"boot.\") || strings.Count(filename, \"/\") != 1 {\n\t\t\t\treturn \"\", fmt.Errorf(\"invalid boot script filename %#q: must be in format 'boot.<OS>/<SCRIPT>'\", filename)\n\t\t\t}\n\t\t\tlayoutPath = filename\n\t\t} else {\n\t\t\tlogrus.Warnf(\"Boot script filename %#q does not contain '/', treating it as a script for Linux and prefixing with 'boot.Linux/'\", filename)\n\t\t}\n\t\tlayout = append(layout, iso9660util.Entry{\n\t\t\tPath:   layoutPath,\n\t\t\tReader: strings.NewReader(string(content)),\n\t\t})\n\t}","sourceCodeStart":397,"sourceCodeEnd":433,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/cidata/cidata.go#L397-L433","documentation":"GenerateISO9660 (pkg/cidata/cidata.go:415) collects driver-specific boot scripts via the driver's BootScripts(ctx) method and packs them into the boot ISO. If that driver call returns an error (driver-specific failure, e.g. context cancellation or internal driver error), it is wrapped with this message. The instance cannot be created without its boot scripts.","triggerScenarios":"Calling limactl start/create where the active driver's BootScripts() fails - underlying driver error, canceled context, or driver initialization problem surfaced during ISO creation.","commonSituations":"Buggy or partially-supported driver (e.g. experimental VM type), interrupted start command, or a driver that fails because required host dependencies are missing.","solutions":["Read the wrapped inner error (`%w`) to identify the driver failure","Verify the chosen `vmType` driver is supported and installed on the host","Retry the command; if it persists, report with the full wrapped error chain"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := limactl.Start(ctx, instName)\nif err != nil {\n    if strings.Contains(err.Error(), \"failed to get boot scripts\") {\n        log.Printf(\"driver failed to supply boot scripts: %v\", errors.Unwrap(err))\n        // switch vmType or retry\n    }\n}","preventionTips":["Use a stable, well-supported vmType driver for the instance","Pass a non-canceled context into start/create calls","Keep Lima up to date; driver BootScripts failures in stable drivers are usually bugs - report them"],"tags":["boot-scripts","driver","iso-generation"],"backgroundTag":"driver-boot-script-failure","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}