[Long-Term Updates] WSL Usage Notes
This is a long-term updated blog post documenting the pitfalls, tips, and optimizations I’ve encountered while using WSL.
Common Issues
File Permission Issues
When mounting a Windows disk in WSL, file permissions default to 777, and running ls reveals everything highlighted in green.
Step 1: Run sudo vim /etc/wsl.conf
1 | [automount] |
Step 2: Restart WSL.
For WSL2, you can run wsl --shutdown in PowerShell or CMD.
For WSL1, run net stop LxssManager and net start LxssManager in PowerShell or CMD with administrator privileges.
For more WSL configuration options, refer to wsl-config.
Disk Issues
If you encounter Error: EPERM: operation not permitted, symlink or any error related to symlink in WSL, first check whether the disk format is NTFS or ReFS.
For more details, read WSL Pitfall: Disk Format Issues.
Time Synchronization Issues
When using WSL, you may occasionally encounter time sync issues where the WSL clock lags behind the Windows 10 system time.
How to fix it?
For Ubuntu, you can use the following commands:
1 | sudo apt install ntpdate |