lima-vm/lima · error

field `tpm` is not supported on VZ driver

Error message

field `tpm` is not supported on VZ driver

What it means

Validation error from the VZ driver's validateConfig (pkg/driver/vz/vz_driver_darwin.go:280), raised during instance create/start when the lima.yaml sets `tpm: true`. The Virtualization.framework-based VZ driver does not implement a software TPM device, so TPM support is only available with the QEMU driver. Fix by removing the `tpm` field or setting it to false, or switching vmType to `qemu`.

Source

Thrown at pkg/driver/vz/vz_driver_darwin.go:280

		return errors.New("configuration is nil")
	}
	macOSProductVersion, err := osutil.ProductVersion()
	if err != nil {
		return err
	}
	if macOSProductVersion.LessThan(*semver.New("13.0.0")) {
		return errors.New("VZ driver requires macOS 13 or higher to run")
	}
	if runtime.GOARCH == "amd64" && macOSProductVersion.LessThan(*semver.New("15.5.0")) {
		logrus.Warnf("vmType %s: On Intel Mac, macOS 15.5 or later is required to run Linux 6.12 or later. "+
			"Update macOS, or change vmType to `qemu` if the VM does not start up. (https://github.com/lima-vm/lima/issues/3334)",
			*cfg.VMType)
	}
	if cfg.MountType != nil && *cfg.MountType == limatype.NINEP {
		return fmt.Errorf("field `mountType` must be %#q or %#q for VZ driver , got %#q", limatype.REVSSHFS, limatype.VIRTIOFS, *cfg.MountType)
	}
	if cfg.TPM != nil && *cfg.TPM {
		return errors.New("field `tpm` is not supported on VZ driver")
	}
	if cfg.OS != nil && *cfg.OS == limatype.WINDOWS {
		return errors.New("currently Windows guest OS is only supported on QEMU")
	}
	if *cfg.Firmware.LegacyBIOS {
		logrus.Warnf("vmType %s: ignoring `firmware.legacyBIOS`", *cfg.VMType)
	}
	for _, f := range cfg.Firmware.Images {
		switch f.VMType {
		case "", limatype.VZ:
			if f.Arch == *cfg.Arch {
				return errors.New("`firmware.images` configuration is not supported for VZ driver")
			}
		}
	}
	if unknown := reflectutil.UnknownNonEmptyFields(cfg, knownYamlProperties...); cfg.VMType != nil && len(unknown) > 0 {
		logrus.Warnf("vmType %s: ignoring %+v", *cfg.VMType, unknown)
	}

View on GitHub (pinned to dd909d0973)

Solutions

  1. Remove the `tpm` field or set it to false
  2. Use the QEMU driver, which supports swtpm, if a TPM is required

Example fix

// before (lima.yaml)
vmType: vz
tpm: true
// after
vmType: vz
tpm: false
Defensive patterns

Strategy: validation

Validate before calling

if vmType == "vz" && tpmEnabled {
    tpmEnabled = false // VZ does not support TPM
}

Try / catch

if err := start(); err != nil && strings.Contains(err.Error(), "`tpm` is not supported") {
    // disable tpm or switch to qemu
}

Prevention

When it happens

Trigger: Config sets tpm: true (or limatype.TPM enabled) while vmType is "vz".

Common situations: Enabling TPM for Windows guest or systemd/measured-boot experiments and using the VZ driver; copying a QEMU config with TPM enabled to a VZ instance.

Related errors


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