{"record":{"id":"007b3026cf26bb43","repo":"abiosoft/colima","slug":"error-copying-vm-config-w","errorCode":null,"errorMessage":"error copying VM config: %w","messagePattern":"error copying VM config: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/clone.go","lineNumber":67,"sourceCode":"\t\t\t).Run(); err != nil {\n\t\t\t\treturn fmt.Errorf(\"error copying VM: %w\", err)\n\t\t\t}\n\t\t}\n\n\t\t{\n\t\t\tlogrus.Info(\"copying config...\")\n\t\t\t// verify source config exists\n\t\t\tif _, err := os.Stat(from.LimaInstanceDir()); err != nil {\n\t\t\t\treturn fmt.Errorf(\"config missing for colima profile '%s': %w\", from.ShortName, err)\n\t\t\t}\n\n\t\t\t// ensure destination config directory\n\t\t\tif err := cli.Command(\"mkdir\", \"-p\", filepath.Dir(to.LimaInstanceDir())).Run(); err != nil {\n\t\t\t\treturn fmt.Errorf(\"cannot copy config to new profile '%s': %w\", to.ShortName, err)\n\t\t\t}\n\n\t\t\tif err := cli.Command(\"cp\", from.LimaInstanceDir(), to.LimaInstanceDir()).Run(); err != nil {\n\t\t\t\treturn fmt.Errorf(\"error copying VM config: %w\", err)\n\t\t\t}\n\t\t}\n\n\t\tlogrus.Info(\"clone successful\")\n\t\tlogrus.Infof(\"run `colima start %s` to start the newly cloned profile\", to.ShortName)\n\t\treturn nil\n\t},\n}\n\nfunc init() {\n\troot.Cmd().AddCommand(cloneCmd)\n\tcloneCmd.Hidden = true\n\n}\n","sourceCodeStart":49,"sourceCodeEnd":82,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/cmd/clone.go#L49-L82","documentation":"Returned by `colima clone` (cmd/clone.go:67) when the final external `cp <from.LimaInstanceDir()> <to.LimaInstanceDir()>` fails while copying the VM/config directory. Note both operands are directories (config/profile.go:68) and the cp is invoked without a recursive flag, so on macOS cp rejects a bare directory source; this hidden command is experimental and this step is fragile.","triggerScenarios":"cp fails because a directory is copied without -R ('cp: ... is a directory (not copied)'), the destination dir already contains the files staged in the earlier step, permissions/disk issues, or the source changed mid-clone.","commonSituations":"Any use of the hidden clone command on a normal profile layout — the final cp semantics make it likely to fail independent of environment; cloneCmd is registered with Hidden = true precisely because it is not production-ready.","solutions":["Prefer supported flows instead of the hidden clone: recreate the profile with `colima start` and the same flags, or file an issue upstream","If copying manually, use recursion: `cp -R <from-instance-dir>/ <to-instance-dir>/`","Check the inner cp error (%w) for permissions or disk causes and fix those","Clean the partial destination profile (`colima delete -f <new-profile>`) before any retry"],"exampleFix":"# before (fragile hidden command)\ncolima clone foo bar   # error copying VM config: ...\n\n# after (manual, recursive)\ncp -R ~/.colima/_lima/foo/ ~/.colima/_lima/bar/\ncolima start -p bar","handlingStrategy":"validation","validationCode":"// Prefer supported recreation over the hidden clone; if scripting it, verify\n// the destination dir is empty and copy recursively yourself\nif entries, _ := os.ReadDir(to.LimaInstanceDir()); len(entries) > 0 {\n    return fmt.Errorf(\"destination not empty; clean it before clone\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat `colima clone` as experimental (it is registered Hidden) — script explicit profile recreation instead","When copying VM dirs manually, always use cp -R","Track upstream issues for clone reliability before depending on it"],"tags":["clone","filesystem","known-issue","colima"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}