lima-vm/lima · error

nested virtualization requires macOS 15 or newer

Error message

nested virtualization requires macOS 15 or newer

What it means

Nested virtualization via VZ (VZGenericPlatformConfiguration.SetNestedVirtualizationEnabled) requires macOS 15 (Sequoia) or newer. attachPlatformConfig checks osutil.ProductVersion() and refuses with this hard error when the host is older than 15.0.0 while nestedVirtualization is enabled in the instance config.

Source

Thrown at pkg/driver/vz/vm_darwin.go:355

	}
	return platformConfig, nil
}

func attachPlatformConfig(inst *limatype.Instance, vmConfig *vz.VirtualMachineConfiguration) error {
	platformConfig, err := newPlatformConfiguration(inst)
	if err != nil {
		return err
	}

	// nested virt
	if *inst.Config.NestedVirtualization {
		macOSProductVersion, err := osutil.ProductVersion()
		if err != nil {
			return fmt.Errorf("failed to get macOS product version: %w", err)
		}

		if macOSProductVersion.LessThan(*semver.New("15.0.0")) {
			return errors.New("nested virtualization requires macOS 15 or newer")
		}

		if !vz.IsNestedVirtualizationSupported() {
			return errors.New("nested virtualization is not supported on this device")
		}

		genericPlatformConfig, ok := platformConfig.(*vz.GenericPlatformConfiguration)
		if !ok {
			return fmt.Errorf("nested virtualization is not supported on %T", platformConfig)
		}

		if err := genericPlatformConfig.SetNestedVirtualizationEnabled(true); err != nil {
			return fmt.Errorf("cannot enable nested virtualization: %w", err)
		}
	}

	vmConfig.SetPlatformVirtualMachineConfiguration(platformConfig)
	return nil

View on GitHub (pinned to dd909d0973)

Solutions

  1. Upgrade the host to macOS 15 (Sequoia) or newer.
  2. Set nestedVirtualization: false in the instance's lima.yaml.
  3. Remove nested virtualization requirements from the workload, or use a Linux host with KVM nested virt via QEMU driver instead.
  4. Check the macOS version with `sw_vers -productVersion` before enabling the option.

Example fix

// before (lima.yaml)
nestedVirtualization: true
// after (lima.yaml)
nestedVirtualization: false  # requires macOS 15+ to enable
Defensive patterns

Strategy: validation

Validate before calling

// preflight: only enable nested virt on macOS 15+
ver=$(sw_vers -productVersion)
[ "$(echo "$ver" | cut -d. -f1)" -ge 15 ] || echo "nestedVirtualization requires macOS 15+ (have $ver)"

Try / catch

// Go: gate the config field on OS version
if macVer.LessThan(*semver.New("15.0.0")) {
    return errors.New("nested virtualization requires macOS 15 or newer")
}

Prevention

When it happens

Trigger: Starting a VZ instance with nestedVirtualization: true on macOS 14.x or older.

Common situations: Copying a template that enables nested virtualization (e.g. for Docker-in-Docker or VM-in-VM) onto an older macOS host; forgetting the OS requirement after migrating the instance.

Related errors


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