Rsync Files Between Linux and Windows: 4 Ways
In this article
- Why rsync Is Not Native to Windows
- Method 1: Use WSL (Windows Subsystem for Linux)
- Method 2: Cygwin or MSYS2
- Method 3: Standalone Windows rsync Builds
- Method 4: Use a Linux rsync Server and a Windows Client
- Choosing the Right Method
- Common Problems and Pitfalls
- Security and Performance Considerations
- Frequently Asked Questions
Yes, you can rsync files between Linux and Windows, but rsync itself is not native to Windows. The practical solutions are to run rsync on Windows via WSL, Cygwin, or a standalone Windows build, or to use a Linux-based rsync server and access it from Windows with an rsync client. This article explains the four main approaches, how to set them up, and which one fits different situations.
Why rsync Is Not Native to Windows
rsync is a Unix tool that relies on POSIX file permissions, symbolic links, and the ssh or rsync protocol for transfers. Windows uses a different file system model (NTFS) and does not include rsync in its standard command set. Early attempts to port rsync directly to Windows were limited by these differences. Today, the most reliable methods wrap rsync in a Unix-like environment or use a compiled binary that emulates the needed system calls.
The core advantage of rsync is its delta algorithm: it transfers only the parts of a file that have changed, not the whole file. That makes it far more efficient than copying entire files over a network, especially for large backups or frequent syncs.
Method 1: Use WSL (Windows Subsystem for Linux)
The most straightforward modern approach is to install WSL on Windows 10 or Windows 11. WSL gives you a real Linux kernel and user space, so you can install rsync with your distribution’s package manager.
- Enable WSL: open PowerShell as Administrator and run
wsl --install. - Reboot if prompted, then launch the installed Linux distribution (e.g., Ubuntu).
- Install rsync:
sudo apt update && sudo apt install rsync(for Debian/Ubuntu). - From the WSL terminal, you can access your Windows files under
/mnt/c/, and your Linux files in the WSL filesystem.
Example command to sync a folder from Windows to a remote Linux server:
rsync -avz /mnt/c/Users/YourName/Documents/ user@server:/backup/WSL is ideal for interactive use and scripting, but it has a performance overhead when reading/writing to the Windows filesystem (/mnt/c). For large transfers, it’s better to keep files inside the WSL filesystem (~/) and then move them to Windows if needed.
Method 2: Cygwin or MSYS2
Before WSL existed, Cygwin was the standard way to run rsync on Windows. Cygwin provides a POSIX compatibility layer, and you can install rsync from its package manager. MSYS2 is a similar environment that is more focused on building native Windows applications.
- Install Cygwin: download the setup executable, choose packages, and select
rsyncandopenssh. - Use the Cygwin terminal: paths like
/cygdrive/c/Users/...map to Windows drives. - MSYS2: install it, then use
pacman -S rsyncto get rsync.
Cygwin is slower than WSL for some operations because of the translation layer, but it is lighter and works on older Windows versions (7, 8).
Method 3: Standalone Windows rsync Builds
There are community-compiled standalone rsync executables for Windows that do not require a full Unix environment. These are often based on the cwRsync project (which itself uses Cygwin libraries) or newer native builds. They come as a single .exe file or a small bundle.
To use one:
- Download the archive and extract it to a folder, e.g.,
C:\rsync. - Add that folder to your PATH environment variable.
- Open Command Prompt or PowerShell and run
rsyncwith the same syntax as on Linux.
Example:
rsync -avz /cygdrive/c/Users/YourName/ user@server:/backup/Note that many standalone builds still use Cygwin-style paths (/cygdrive/c/), not Windows paths. Check the documentation of the specific build you download.
Method 4: Use a Linux rsync Server and a Windows Client
If you want to rsync to a Linux machine from Windows, you can run an rsync daemon on the Linux side and use a Windows client that supports the rsync protocol. The most common client is DeltaCopy, a GUI wrapper around rsync that runs as a Windows service.
- Install DeltaCopy on Windows.
- On the Linux server, configure
/etc/rsyncd.confto define a module (a shared directory). - In DeltaCopy, create a job that connects to the Linux server’s IP and module name.
This approach is good for scheduled backups, but it requires opening port 873 (or using SSH tunneling). It is less flexible than using rsync over SSH because the daemon does not encrypt traffic by default.
Choosing the Right Method
The best method depends on your use case:
- WSL: best for developers who already use WSL, need full Linux compatibility, or want to use rsync over SSH with key authentication.
- Cygwin/MSYS2: good for older Windows systems or when you need a minimal install.
- Standalone builds: convenient for simple one-off transfers without setting up a whole environment, but beware of path differences.
- DeltaCopy: ideal for non-technical users who want a GUI and scheduled backups.
For most people today, WSL is the recommended route because it gives you a genuine Linux environment and avoids the path and permission quirks of the other methods.
Common Problems and Pitfalls
When rsyncing between Linux and Windows, you may encounter:
- Permission errors: Windows files often have different ownership and permission bits. Use
-rltDinstead of-ato avoid trying to copy Unix permissions that don’t apply. - Path separators: rsync expects forward slashes. In Cygwin, use
/cygdrive/c/; in WSL, use/mnt/c/. - Line endings: text files may have CRLF vs LF. Use
--iconvfor character set conversion if needed, but for binary files it’s irrelevant. - Symbolic links: Windows doesn’t support Unix symlinks natively. Use
--no-linksto skip them or--copy-linksto copy the target. - Firewall: if using the rsync daemon, ensure port 873 is open. If using SSH, port 22 must be open.
A frequent misconception is that rsync can directly copy between two Windows machines. It can, but only if both have rsync installed and one acts as a server. The same methods apply.
Security and Performance Considerations
Always prefer rsync over SSH (using -e ssh or the ssh: prefix) to encrypt the transfer. The rsync daemon protocol is unencrypted, so anyone on the network can see your data. If you must use the daemon, consider tunneling it through SSH or a VPN.
For performance, note that WSL’s access to Windows drives is slower than native Linux. If you are syncing a huge directory, copy it to the WSL filesystem first, then rsync from there. Also, use the --partial option to resume interrupted transfers, and --progress to monitor.
Finally, test your rsync command with --dry-run (-n) to see what would be transferred without actually doing it. This is especially important on Windows where path mapping can cause surprises.
Frequently Asked Questions
Can I use rsync directly in PowerShell?
No, rsync is not a native Windows command. You need to install WSL, Cygwin, or a standalone build. PowerShell can call the executable if it’s in your PATH, but the syntax and paths will still be Unix-like.
How do I sync a Windows folder to a Linux server automatically?
Use a scheduled task (Task Scheduler) to run the rsync command. For example, create a batch file with the rsync command and schedule it daily. Alternatively, use DeltaCopy’s built-in scheduler.
Why do I get “Permission denied” when rsyncing to a Windows folder?
This often happens because the Windows user account running rsync doesn’t have write permissions to the destination folder, or because you’re trying to preserve Unix permissions with -a. Try using -rltD and ensure the destination folder has “Modify” permissions for your user.
Is there a GUI for rsync on Windows?
Yes, DeltaCopy is a popular GUI wrapper. There is also grsync (available via Cygwin or WSL) and SyncThing (which uses its own protocol, not rsync). For WSL, you can use the command line or a script.
Can I rsync from Windows to Windows?
Yes, but both machines need an rsync implementation. You can run an rsync daemon on one machine (using Cygwin or a standalone build) and use a client on the other. Alternatively, use WSL on both machines.