lima-vm/lima · error

mount type %#q is explicitly unsupported

Error message

mount type %#q is explicitly unsupported

What it means

validateMountType() first checks the user's own deny-list: if `mountTypesUnsupported` in lima.yaml contains the currently configured `mountType`, the config directly contradicts itself, so validation fails. This fires before any per-OS compatibility checks.

Source

Thrown at pkg/driver/qemu/qemu_driver.go:149

// Helper method for checking the binary signature on macOS.
func validateArch(ctx context.Context, cfg *limatype.LimaYAML) error {
	if runtime.GOOS == "darwin" {
		var vmArch string
		if cfg.Arch != nil {
			vmArch = *cfg.Arch
		}
		if err := checkBinarySignature(ctx, vmArch); err != nil {
			return err
		}
	}
	return nil
}

// Helper method for mount type validation.
func validateMountType(cfg *limatype.LimaYAML) error {
	// 1. First, check if the user explicitly blocked this mount type in their config.
	if cfg.MountTypesUnsupported != nil && cfg.MountType != nil && slices.Contains(cfg.MountTypesUnsupported, *cfg.MountType) {
		return fmt.Errorf("mount type %#q is explicitly unsupported", *cfg.MountType)
	}

	// 2. Then, check if the mount type is valid for the current Operating System.
	if cfg.MountType != nil {
		switch runtime.GOOS {
		case "linux":
			switch *cfg.MountType {
			case limatype.REVSSHFS, limatype.NINEP, limatype.VIRTIOFS:
				return nil
			default:
				return fmt.Errorf("field `mountType` must be one of %v for QEMU driver on Linux, got %#q", []string{limatype.REVSSHFS, limatype.NINEP, limatype.VIRTIOFS}, *cfg.MountType)
			}
		case "darwin":
			switch *cfg.MountType {
			case limatype.REVSSHFS, limatype.NINEP:
				return nil
			default:
				return fmt.Errorf("field `mountType` must be %#q or %#q for QEMU driver on macOS, got %#q", limatype.REVSSHFS, limatype.NINEP, *cfg.MountType)

View on GitHub (pinned to dd909d0973)

Solutions

  1. Remove the active mountType from the `mountTypesUnsupported` list in lima.yaml.
  2. Or change `mountType` to a value not listed in `mountTypesUnsupported`.
  3. If using template inheritance, check which layer sets each field and reconcile them.

Example fix

# before
mountType: virtiofs
mountTypesUnsupported:
  - virtiofs
// after
mountType: virtiofs
mountTypesUnsupported: []
Defensive patterns

Strategy: validation

Validate before calling

if cfg.MountType != nil && slices.Contains(cfg.MountTypesUnsupported, *cfg.MountType) {
    return fmt.Errorf("mountType %s conflicts with mountTypesUnsupported deny-list", *cfg.MountType)
}

Type guard

func mountTypeAllowed(cfg *limatype.LimaYAML) bool {
    return cfg.MountType == nil || !slices.Contains(cfg.MountTypesUnsupported, *cfg.MountType)
}

Try / catch

if err := drv.Validate(ctx); err != nil && strings.Contains(err.Error(), "explicitly unsupported") {
    // reconcile mountType vs mountTypesUnsupported in the YAML, then retry
}

Prevention

When it happens

Trigger: lima.yaml containing both `mountType: virtiofs` and `mountTypesUnsupported: [virtiofs]` (or any mountType listed in mountTypesUnsupported), for the QEMU driver.

Common situations: Template inheritance/composition where an included template disables a mount type the base template sets; hand-edited configs that added a mount type to the unsupported list after choosing it as the active type.

Related errors


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