Rsync-pull from Windows WSL

  • I posted this earlier here but was recommended to open a new thread.


    What I want to do:


    On the OMV machine, tun Rsync remote pull from a Windwos 11 / WSL instance to an OMV 8.1.2-1 (Synchrony) installation.

    I'm aware this involves a few tricky things - port forwarding to WSL on the Windows side etc. - but I was able to resolve these, and make the Rsync job work on the OMV machine's command line level.

    Here's the command that I can run successfully on the OMV machine's CLI:


    Code
    rsync -av -e 'ssh -p 2022' <WSL-user>@<IP-of-Windows-machine>:/mnt/<Windows-drive-letter>/'source directory' /srv/dev-disk-by-uuid-XXXX/.../target_share/target_directory

    The Windows machine is set to forward SSH requests to its port 2022 to port 22 of the WSL virtual instance (while port 22 of the Windows machine is used for SSH requests to Windows). It took me a while to figure this out, but ... it works: After entering this command, I'm prompted for the WSL-user's password, and the Rsync job is successfully executed.


    However, I wasn't able to make it work out of the OMV web interface for Rsync. I tried, increasingly erratically, quite a few configuration variants (including, of course, adding the :2022 port to the remote IP address), but kept receiving "access denied" or "host not recognized" error messages.


    Any suggestions / shared experiences / help? Thanks!

  • votdev

    Approved the thread.
  • I just tested on a Linux machine, but it should be approximately the same on WSL.


    step 1: SSH to your OMV installation with ROOT user

    step 2: run ssh-copy-id -p 2022 <WSL-user>@<IP-of-Windows-machine>

    • here you enter the WSL user password
    • if you receive any error messages, post them here or fix them, do not go to next step.

    step 3: ssh -p 2022 <WSL-user>@<IP-of-Windows-machine>

    • here it should not ask for password and directly ssh to your WSL
    • if it asks for password, then you had some error on step 2 - fix it

    step 4: create a new rsync task on OMV web ui:

    • mode: pull
    • source server: <WSL-user>@<IP-of-Windows-machine>:<full_path_to_folder_you_want_to_sync>
    • destination shared folder: your shared folder on OMV where you want to sync
    • authentication: password
    • extra options: -e 'ssh -p 2022'

    rest of the settings unchanged

    step 5: save and apply

    step 6: run task

    • here it successfully copied the folder contents from my Linux machine to OMV shared folder


    PS: sorry about multiple edits, I finally managed to make it work on port 2022 on my Linux machine :)

  • Works flawlessly as described.

    (I believe I just had overlooked the "extra options" input field at the bottom of OMV's Rsync configuration screen.)


    Thank you so much!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!