I installed Ubuntu 22.04 in WSL2 and I want to transfer files from Ubuntu 20.04 that is installed in a same Windows.
At first I send files via mounted Windows files sysmtem.
Rsync in Ubuntu 20.04:
rsync ~/foo /mnt/c/tmp
Rsync in Ubuntu 22.04:
rsync /mnt/c/tmp ~/foo
But with this way permissions are collapsed.
Is there are recommended way to transfer files between two WSL systems?
-avzparameters with Rsync? That is standard for many Rsync commands. The key is the-aparameter which is the--archivemode that preserves ownership and permissions. The-vis verbose mode and-zcompresses files during the transfer. You could try it with just-alike thisrsync -a ~/foo /mnt/c/tmpor evenrsync -a /mnt/c/tmp ~/foo. Let me know if this works for you and I can post it as an answer. – Giacomo1968 Oct 17 '22 at 02:03/mnt/c(which doesn't quite match up with your title) will have permission issues unless you add themetadatamount option as in this answer. – NotTheDr01ds Oct 17 '22 at 02:17