{"record":{"id":"80b9fd08e5cf9d97","repo":"lima-vm/lima","slug":"more-than-one-instance-host-is-involved-in-this","errorCode":null,"errorMessage":"more than one (instance) host is involved in this command, this is only supported for openSSH v8.0 or higher","messagePattern":"more than one \\(instance\\) host is involved in this command, this is only supported for openSSH v8\\.0 or higher","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/copytool/scp.go","lineNumber":91,"sourceCode":"\t}\n\tlegacySSH := sshutil.DetectOpenSSHVersion(ctx, sshExeForVersion).LessThan(*semver.New(\"8.0.0\"))\n\n\tfor _, cp := range copyPaths {\n\t\tif cp.IsRemote {\n\t\t\tif legacySSH {\n\t\t\t\tscpFlags = append(scpFlags, \"-P\", fmt.Sprintf(\"%d\", cp.Instance.SSHLocalPort))\n\t\t\t\tscpArgs = append(scpArgs, fmt.Sprintf(\"%s:%s\", *cp.Instance.Config.User.Name+\"@\"+cp.Instance.SSHAddress, cp.Path))\n\t\t\t} else {\n\t\t\t\tscpArgs = append(scpArgs, fmt.Sprintf(\"scp://%s:%d/%s\", *cp.Instance.Config.User.Name+\"@\"+cp.Instance.SSHAddress, cp.Instance.SSHLocalPort, cp.Path))\n\t\t\t}\n\t\t\tinstances[cp.InstanceName] = cp.Instance\n\t\t} else {\n\t\t\tscpArgs = append(scpArgs, cp.Path)\n\t\t}\n\t}\n\n\tif legacySSH && len(instances) > 1 {\n\t\treturn nil, errors.New(\"more than one (instance) host is involved in this command, this is only supported for openSSH v8.0 or higher\")\n\t}\n\n\tscpFlags = append(scpFlags, \"-3\", \"--\")\n\tscpArgs = append(scpFlags, scpArgs...)\n\n\tvar sshOpts []string\n\tif len(instances) == 1 {\n\t\t// Only one (instance) host is involved; we can use the instance-specific\n\t\t// arguments such as ControlPath.  This is preferred as we can multiplex\n\t\t// sessions without re-authenticating (MaxSessions permitting).\n\t\tfor _, inst := range instances {\n\t\t\tsshExe, err := sshutil.NewSSHExe()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tsshOpts, err = sshutil.SSHOpts(ctx, sshExe, inst.Dir, *inst.Config.User.Name, false, false, false, false)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/copytool/scp.go#L73-L109","documentation":"scp's legacy (pre-OpenSSH 8.0) protocol cannot combine multiple remote hosts with the -3 (third-party copy through the local host) option used by Command. The library therefore rejects commands that involve more than one instance host when the resolved scp/ssh is older than OpenSSH 8.0.","triggerScenarios":"Calling Command on an scpTool whose legacySSH flag is true (ssh version < 8.0 detected or version detection failed) while the command involves more than one instance (copying between two guests, or host-to-guest-to-host with multiple hosts).","commonSituations":"Older LTS distros (e.g. CentOS 7, Ubuntu 16.04) shipping OpenSSH 7.x where users attempt multi-instance `limactl cp` operations.","solutions":["Upgrade OpenSSH on the host to 8.0 or higher so multi-host -3 copies are supported.","Restrict the command to a single instance host per invocation.","Use rsync backend instead, which supports multi-host copies on older ssh versions."],"exampleFix":"// before (OpenSSH 7.4 host)\nlimactl cp instA:file instB:file\n// after: upgrade openssh, or copy in two steps\n// limactl cp instA:file ./file\n// limactl cp ./file instB:file","handlingStrategy":"validation","validationCode":"out, err := exec.Command(\"ssh\", \"-V\").CombinedOutput()\n// parse e.g. \"OpenSSH_7.4\"; if major < 8, avoid multi-instance cp","typeGuard":null,"tryCatchPattern":"args, err := scpTool.Command(ctx, ...)\nif err != nil && strings.Contains(err.Error(), \"openSSH v8.0 or higher\") {\n    // degrade: split the copy into per-instance steps\n}\nreturn err","preventionTips":["Keep host OpenSSH at >= 8.0 (check with ssh -V).","Restrict multi-instance copies to environments where OpenSSH >= 8.0 is guaranteed.","Prefer rsync backend for multi-host transfers on legacy hosts."],"tags":["scp","openssh-version","multi-host","compatibility"],"backgroundTag":"openssh-version-too-old","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}