abiosoft/colima · error

invalid mountType: '%s'

Error message

invalid mountType: '%s'

What it means

ValidateConfig rejects the mountType field. Allowed values are '9p' and 'sshfs' unconditionally, plus 'virtiofs' only when util.MacOS13OrNewer() reports macOS 13 Ventura or newer. Any other value, including virtiofs on older macOS or Linux, fails with the offending value echoed in the message.

Source

Thrown at config/configmanager/configmanager.go:59

	err = yaml.Unmarshal(b, &c)
	if err != nil {
		return c, fmt.Errorf("could not load config from file: %w", err)
	}

	return c, nil
}

// ValidateConfig validates config before we use it
func ValidateConfig(c config.Config) error {
	validMountTypes := map[string]bool{"9p": true, "sshfs": true}
	validPortForwarders := map[string]bool{"grpc": true, "ssh": true, "none": true}

	if util.MacOS13OrNewer() {
		validMountTypes["virtiofs"] = true
	}
	if _, ok := validMountTypes[c.MountType]; !ok {
		return fmt.Errorf("invalid mountType: '%s'", c.MountType)
	}
	validVMTypes := map[string]bool{"qemu": true}
	if util.MacOS13OrNewer() {
		validVMTypes["vz"] = true
	}
	if util.MacOS13OrNewerOnArm() {
		validVMTypes["krunkit"] = true
	}
	if c.VMType == "krunkit" && !util.MacOS13OrNewerOnArm() {
		return fmt.Errorf("vmType 'krunkit' is only available on macOS with Apple Silicon")
	}
	if _, ok := validVMTypes[c.VMType]; !ok {
		return fmt.Errorf("invalid vmType: '%s'", c.VMType)
	}
	if c.VMType == "qemu" {
		if err := util.AssertQemuImg(); err != nil {
			return fmt.Errorf("cannot use vmType: '%s', error: %w", c.VMType, err)
		}

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. Set mountType to a supported value for your platform: '9p' or 'sshfs' anywhere, 'virtiofs' on macOS 13+ only
  2. If virtiofs is required on a Mac, upgrade to macOS 13 or newer
  3. Check spelling and case: validation is an exact lowercase key lookup in the validMountTypes map

Example fix

# before (on macOS 12 or Linux)
mountType: virtiofs

# after
mountType: 9p
Defensive patterns

Strategy: validation

Validate before calling

func validMountType(mountType string, macOS13OrNewer bool) bool {
    switch mountType {
    case "9p", "sshfs":
        return true
    case "virtiofs":
        return macOS13OrNewer
    }
    return false
}

Try / catch

if err := configmanager.ValidateConfig(c); err != nil {
    if strings.HasPrefix(err.Error(), "invalid mountType") {
        // reset to a portable value and revalidate
        c.MountType = "9p"
    }
}

Prevention

When it happens

Trigger: Loading or applying a config where mountType is 'virtiofs' on macOS 12 or older, or on Linux; a typo or case variant such as '9P', 'virtio_fs', 'sshFS'; an empty mountType left behind by a partial config migration.

Common situations: Config created on macOS 13+ then synced to an older Mac or a Linux host; copy-pasted configs from tutorials assuming virtiofs; downgrading macOS without adjusting the config; exact-match string comparison catching case differences.

Related errors


AI-assisted analysis of abiosoft/colima@c3a5f9184d (2026-08-15). Data as JSON: /api/errors/649b35703dc2dee9. Report an issue: GitHub.