lima-vm/lima · error

failed to get boot scripts

Error message

failed to get boot scripts: %w

What it means

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.

Solutions

  1. Read the wrapped inner error (`%w`) to identify the driver failure
  2. Verify the chosen `vmType` driver is supported and installed on the host
  3. Retry the command; if it persists, report with the full wrapped error chain
Defensive patterns

Strategy: try-catch

Try / catch

err := limactl.Start(ctx, instName)
if err != nil {
    if strings.Contains(err.Error(), "failed to get boot scripts") {
        log.Printf("driver failed to supply boot scripts: %v", errors.Unwrap(err))
        // switch vmType or retry
    }
}

Prevention

When it happens

Trigger: Calling limactl start/create where the active driver's BootScripts() fails - underlying driver error, canceled context, or driver initialization problem surfaced during ISO creation.

Common situations: Buggy or partially-supported driver (e.g. experimental VM type), interrupted start command, or a driver that fails because required host dependencies are missing.

Related errors


AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01). Data as JSON: /api/errors/7b0ec0aa466b1a49. Report an issue: GitHub.

Appendix: source

Thrown at pkg/cidata/cidata.go:415

// in instDir. It returns the instance ID, which changes on every boot.
func 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) {
	args, err := templateArgs(ctx, true, instDir, name, instConfig, udpDNSLocalPort, tcpDNSLocalPort, vsockPort, virtioPort, noCloudInit, rosettaEnabled, rosettaBinFmt)
	if err != nil {
		return "", err
	}

	if err := ValidateTemplateArgs(args); err != nil {
		return "", err
	}

	layout, err := ExecuteTemplateCIDataISO(args)
	if err != nil {
		return "", err
	}

	driverScripts, err := drv.BootScripts(ctx)
	if err != nil {
		return "", fmt.Errorf("failed to get boot scripts: %w", err)
	}

	for filename, content := range driverScripts {
		layoutPath := path.Join("boot.Linux", filename)
		if strings.Contains(filename, "/") {
			// When the filename contains a slash, it must be in the format of "boot.<OS>/<SCRIPT>"
			if !strings.HasPrefix(filename, "boot.") || strings.Count(filename, "/") != 1 {
				return "", fmt.Errorf("invalid boot script filename %#q: must be in format 'boot.<OS>/<SCRIPT>'", filename)
			}
			layoutPath = filename
		} else {
			logrus.Warnf("Boot script filename %#q does not contain '/', treating it as a script for Linux and prefixing with 'boot.Linux/'", filename)
		}
		layout = append(layout, iso9660util.Entry{
			Path:   layoutPath,
			Reader: strings.NewReader(string(content)),
		})
	}

View on GitHub (pinned to dd909d0973)