lima icon indicating copy to clipboard operation
lima copied to clipboard

`limactl copy` should use `rsync` instead of `scp` for copying a directory

Open AkihiroSuda opened this issue 1 year ago • 3 comments

Description

limactl copy should use rsync (present on macOS by default) instead of scp for copying a directory. scp might be still faster for small directories, but probably the overhead is subtle.

https://github.com/lima-vm/lima/blob/eebc6847fb8f5d55e489fdc2948c6acafc2d5436/cmd/limactl/copy.go#L47

AkihiroSuda avatar Feb 09 '24 03:02 AkihiroSuda

You could make it optional, like we ended up doing for docker-machine scp?

Usage: docker-machine scp [OPTIONS] [arg...]

Copy files between machines

Description:
   Arguments are [[user@]machine:][path] [[user@]machine:][path].

Options:
   
   --recursive, -r	Copy files recursively (required to copy directories)
   --delta, -d		Reduce amount of data sent over network by sending only the differences (uses rsync)
   --quiet, -q		Disables the progress meter as well as warning and diagnostic messages from ssh

(my suggestion was --rsync, since it does has some rather tricky semantics)

Main reason is that it would require to install rsync on the guest as well...

afbjorklund avatar Feb 09 '24 07:02 afbjorklund

@AkihiroSuda Can I work on this?

ayushgml avatar Mar 04 '24 13:03 ayushgml

I found that I had to add --progress, to make the rsync output more similar to scp default output:

https://github.com/lima-vm/lima/pull/2028/commits/a63be723430d03a1c644a85986d6cc97d5b83dd6

afbjorklund avatar Mar 04 '24 13:03 afbjorklund