Copying a folder with thousands of files from Windows to WSL is significantly slower than native Linux operations because the Windows filesystem (NTFS) and the WSL2 virtual hard disk (ext4) are separate storage layers. This process requires data to traverse the interoperability bridge, which introduces substantial overhead for metadata operations like creating individual inodes, setting permissions, and handling timestamps. To resolve this bottleneck, you must minimize the number of discrete file system calls by bundling the data into a single archive before transfer or moving the entire directory structure at once rather than copying contents recursively.
Understanding the Performance Bottleneck
The core issue lies in how WSL2 accesses Windows files. When you run
cp -r /mnt/c/path/to/large_folder ~/destination, every single file triggers a context switch between the Windows kernel and the Linux VM. For a folder containing 10,000 small files, this results in tens of thousands of network-like packets being sent over the loopback interface to update the ext4 filesystem. Each operation involves checking permissions, updating journal logs, and managing inode allocations, which accumulates massive latency compared to native Linux copy speeds.
Additionally, antivirus software on the Windows host often scans each file as it is written to the WSL disk, further throttling the throughput. The combination of high I/O operations per second (IOPS) requirements and security scanning creates a perfect storm for slow transfers. Recognizing that this is a structural limitation of the hybrid architecture rather than a bug in your specific installation is the first step toward optimizing the workflow.
Method 1: Archive and Extract (Recommended)
The most effective way to bypass the overhead of individual file creation is to treat the folder as a single binary stream. By compressing the directory on the Windows side and extracting it within WSL, you reduce thousands of file operations into one large read/write cycle.
First, open PowerShell or Command Prompt on Windows and navigate to the parent directory of the folder you wish to move. Use the
tar command to create a gzip-compressed archive. This command bundles the directory structure and all contents into a single
.tar.gz file.
tar -czf large_folder.tar.gz large_folder/
Next, move this archive into your WSL home directory or any accessible path. You can drag and drop the file into the WSL terminal window or use
wsl cp. Once the archive is inside the Linux environment, extract it using the standard
tar utility.
tar -xzf large_folder.tar.gz
This method is dramatically faster because the ext4 filesystem handles one large sequential write operation instead of thousands of random small writes. It also preserves file permissions and ownership correctly during the extraction phase, ensuring that your development environment remains consistent.
Method 2: Move the Entire Directory Tree
If archiving is not feasible due to space constraints or the need for immediate access, you should avoid copying the *contents* of the folder. Instead, copy the folder itself as a single entity. The Windows-to-WSL bridge optimizes for directory-level moves more efficiently than recursive content copies.
In your WSL terminal, use
mv to move the directory from the mounted Windows drive to your Linux home directory.
mv /mnt/c/Users/YourName/LargeFolder ~/LargeFolder
This approach leverages the underlying volume management capabilities of the bridge. While still slower than native Linux performance, it avoids the repeated inode allocation overhead associated with
cp -r. After the move completes, verify that all symlinks and special files have been preserved correctly, as some complex directory structures may require manual adjustment if they rely on absolute paths rooted in
/mnt/c.
Optimizing WSL Configuration
You can mitigate some performance issues by adjusting how WSL mounts Windows drives. In your
~/.wsl.conf file, ensure that the
automount section is configured correctly. Setting
mountFsTab to
false can sometimes reduce startup overhead, though its impact on copy speed is minimal. More importantly, ensure that your WSL instance is updated to the latest version, as Microsoft frequently optimizes the interoperability layer.
[automount]
enabled = true
mountFsTab = false
options = "metadata,umask=22,fmask=11"
The
metadata option is critical. It allows WSL to store POSIX permissions directly on the NTFS extended attributes, reducing the need for constant lookups against Windows ACLs during file operations. Without this flag, every file access requires a round-trip to query Windows security descriptors, which severely degrades performance for large directories.
Alternative: Direct Disk Access
For extremely large datasets exceeding hundreds of gigabytes, consider mounting the physical Windows partition directly in WSL using
wsl --mount. This bypasses the
/mnt/c interoperability layer entirely, providing near-native Linux performance for reading and writing data. However, this requires administrative privileges and careful handling to prevent data corruption if both Windows and WSL attempt to modify the same files simultaneously.
Frequently Asked Questions
Why is my WSL instance so slow even after transferring files?
Slow general performance is often caused by running heavy processes on the Windows host, such as real-time antivirus scanning. Disable real-time protection temporarily or add your WSL home directory and
/mnt/c to the exclusion list to see if performance improves significantly.
Can I use rsync to speed up incremental transfers?
While
rsync is efficient for syncing changes, it does not solve the initial bulk transfer bottleneck because it still performs individual file operations. Use
rsync only after the initial large copy has been completed via archival methods to sync minor updates.
Does WSL1 handle large folder copies faster than WSL2?
WSL1 uses a direct translation layer without a virtual machine, which can sometimes feel snappier for simple file listings. However, WSL2’s ext4 filesystem is generally superior for development workloads, and the performance gap for large transfers has narrowed significantly with recent Windows updates.
What happens if I interrupt a large copy operation?
Interrupting a copy mid-stream can leave partial files and corrupted directory entries. Always cancel gracefully using
Ctrl+C in the terminal, then verify the integrity of the destination directory before attempting to resume or re-copy.
How do I check if my WSL version is outdated?
Run
wsl --update in an elevated PowerShell window to fetch the latest kernel and utilities. Keeping your WSL components updated ensures you benefit from the latest performance patches and bug fixes related to file I/O.