abiosoft/colima · error

colima profile '%s' does not exist

Error message

colima profile '%s' does not exist

What it means

Returned by the hidden `colima clone <profile> <new-profile>` command (cmd/clone.go:29) when os.Stat on the source profile's Lima instance directory (config.Profile.LimaInstanceDir(), config/profile.go:68 — <lima-home>/<profile-id>) fails or the path is not a directory. The clone cannot proceed because there is no VM to copy from.

Source

Thrown at cmd/clone.go:29

	"github.com/sirupsen/logrus"
	"github.com/spf13/cobra"
)

// stopCmd represents the stop command
var cloneCmd = &cobra.Command{
	Use:   "clone <profile> <new-profile>",
	Short: "clone Colima profile",
	Long:  `Clone the Colima profile.`,
	Args:  cobra.ExactArgs(2),
	RunE: func(cmd *cobra.Command, args []string) error {
		from := config.ProfileFromName(args[0])
		to := config.ProfileFromName(args[1])

		logrus.Infof("preparing to clone %s...", from.DisplayName)
		{
			// verify source profile exists
			if stat, err := os.Stat(from.LimaInstanceDir()); err != nil || !stat.IsDir() {
				return fmt.Errorf("colima profile '%s' does not exist", from.ShortName)
			}

			// verify destination profile does not exists
			if stat, err := os.Stat(to.LimaInstanceDir()); err == nil && stat.IsDir() {
				return fmt.Errorf("colima profile '%s' already exists, delete with `colima delete %s` and try again", to.ShortName, to.ShortName)
			}

			// copy source to destination
			logrus.Info("cloning virtual machine...")
			if err := cli.Command("mkdir", "-p", to.LimaInstanceDir()).Run(); err != nil {
				return fmt.Errorf("error preparing to copy VM: %w", err)
			}

			if err := cli.Command("cp",
				filepath.Join(from.LimaInstanceDir(), "basedisk"),
				filepath.Join(from.LimaInstanceDir(), "diffdisk"),
				filepath.Join(from.LimaInstanceDir(), "cidata.iso"),
				filepath.Join(from.LimaInstanceDir(), "lima.yaml"),

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. List existing profiles with `colima list` (or `colima list -a`) and use the exact profile name
  2. If the profile does not exist yet, create it first: `colima start -p <profile>`
  3. If it should exist, verify the Lima instance dir is present (colima list output paths) and re-create the profile if its files are gone

Example fix

# before
colima clone tpyo newprofile   # colima profile 'tpyo' does not exist

# after
colima list                    # confirm the real name, e.g. 'typo'
colima clone typo newprofile
Defensive patterns

Strategy: validation

Validate before calling

// Verify the source profile exists before cloning
from := config.ProfileFromName(srcName)
if stat, err := os.Stat(from.LimaInstanceDir()); err != nil || !stat.IsDir() {
    return fmt.Errorf("source profile '%s' missing; create it first with `colima start -p %s`", srcName, srcName)
}

Try / catch

if err := runClone(src, dst); err != nil {
    if strings.Contains(err.Error(), "does not exist") {
        // bad source name: list profiles (colima list) and correct the argument
    }
    return err
}

Prevention

When it happens

Trigger: Running `colima clone foo bar` when profile 'foo' has never been created, was deleted, has a misspelled name, or its Lima instance directory was removed manually.

Common situations: Typo in the source profile name; cloning after `colima delete`; profile exists in ~/.colima but its Lima instance dir under the lima home (~/.colima/_lima by default) was wiped.

Related errors


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