{"record":{"id":"e3d44f7844e41bc0","repo":"lima-vm/lima","slug":"rsync-is-required-for-sync-but-not-found-w","errorCode":null,"errorMessage":"rsync is required for `--sync` but not found: %w","messagePattern":"rsync is required for `--sync` but not found: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/limactl/shell.go","lineNumber":252,"sourceCode":"\t}\n\tif err == nil {\n\t\thostCurrentDir = hostCurrentDirNative\n\t\tif runtime.GOOS == \"windows\" {\n\t\t\thostCurrentDir, err = mountDirFromWindowsDir(ctx, inst, hostCurrentDirNative)\n\t\t}\n\t}\n\n\tif err != nil {\n\t\t// An empty hostCurrentDir would reach rsync as the toolchain root.\n\t\tif syncHostWorkdir {\n\t\t\treturn fmt.Errorf(\"failed to determine the host directory to sync: %w\", err)\n\t\t}\n\t\tchangeDirCmd = \"false\"\n\t\tlogrus.WithError(err).Warn(\"failed to get the current directory\")\n\t}\n\tif syncHostWorkdir {\n\t\tif _, err := exec.LookPath(string(copytool.BackendRsync)); err != nil {\n\t\t\treturn fmt.Errorf(\"rsync is required for `--sync` but not found: %w\", err)\n\t\t}\n\n\t\t// Measure the host's own path. The form hostCurrentDir carries on Windows\n\t\t// adds one component (/c/...) or two (/cygdrive/c/...).\n\t\tsrcWdDepth := pathDepth(hostCurrentDirNative, runtime.GOOS == \"windows\")\n\t\tif srcWdDepth < rsyncMinimumSrcDirDepth {\n\t\t\treturn fmt.Errorf(\"expected the depth of the host working directory (%#q) to be at least %d, only got %d (Hint: %s)\",\n\t\t\t\thostCurrentDirNative, rsyncMinimumSrcDirDepth, srcWdDepth, \"cd to a deeper directory\")\n\t\t}\n\t\t// rsync acts on hostCurrentDir, so measure that too: cygpath can report\n\t\t// success without writing a path, and an fstab can map a deep directory\n\t\t// onto a shallow one. It is always POSIX form, even on Windows.\n\t\tif dstWdDepth := pathDepth(hostCurrentDir, false); dstWdDepth < rsyncMinimumSrcDirDepth {\n\t\t\treturn fmt.Errorf(\"expected the depth of the converted host working directory (%#q) to be at least %d, only got %d\",\n\t\t\t\thostCurrentDir, rsyncMinimumSrcDirDepth, dstWdDepth)\n\t\t}\n\t}\n","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/cmd/limactl/shell.go#L234-L270","documentation":"The `--sync` mechanism is implemented exclusively with rsync on the host side. shellAction checks `exec.LookPath(\"rsync\")` before attempting any sync and aborts with this error when the rsync binary cannot be found in the host `PATH`.","triggerScenarios":"Running `limactl shell <instance> --sync <dir>` on a host where no `rsync` executable is present in PATH.","commonSituations":"Fresh macOS/Linux/Windows machines without rsync installed (rsync is no longer bundled by default on some distros/macOS CI images); a minimal container or CI runner; a Windows host without rsync in PATH.","solutions":["Install rsync on the host (e.g. `brew install rsync`, `apt-get install rsync`, `choco install rsync` or via MSYS2/Cygwin).","Ensure the rsync binary's directory is on your `PATH` (`which rsync` / `where rsync` must succeed).","If rsync cannot be installed, drop `--sync` and use regular mounts."],"exampleFix":"# before\nlimactl shell default --sync .   # fails: rsync not found\n# after\nbrew install rsync   # or apt-get install rsync\nlimactl shell default --sync .","handlingStrategy":"validation","validationCode":"command -v rsync >/dev/null 2>&1 || { echo 'rsync is required for --sync'; exit 1; }","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Install rsync as part of machine/bootstrap setup for Lima hosts.","Run `command -v rsync` in CI before jobs that use --sync.","Keep fallback instructions (use mounts instead of --sync) documented."],"tags":["cli","limactl","rsync","missing-binary","sync"],"backgroundTag":"missing-binary-dependency","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}