Leverage the convenience of bidirectional clipboard sharing in WSL 2 without the complex setup of VcXsrv. This article guides you through using WSLg for seamless copy-paste between Windows and Linux.
Clipboard Sharing Before WSLg with VcXsrv
For years, I used VcXsrv to enable clipboard sharing between Windows and WSL. Although it worked well, it required several steps for setup.
- Installing VcXsrv
- Configuring VcXsrv
- Setting up VcXsrv to start up with Windows
- Configuring .wslconfig in Windows
- Configuring your WSL distro to set the DISPLAY in your shell
After updating my dotfiles, I decided to test if the landscape has changed. Thanks to WSLg, setting things up is now simpler.
Why Switch?
While VcXsrv was reliable, it required several steps for setup. By migrating to WSLg, you can benefit from a more straightforward setup process, making it easier for others to use your dotfiles.
Is WSLg Better?
For times when you need both X and Wayland apps with GPU support, WSLg excels. For clipboard sharing, as of May 2025, VcXsrv may still be superior, but WSLg provides a reasonable alternative.
WSLg automatically handles Windows line endings when pasting into Linux apps, converting CRLF into LF. However, when pasting from Windows into Linux, WSLg may add trailing ^M characters. This issue has been reported on GitHub, and solutions are being explored.
Demo Video
This video (Video ID) demonstrates topics related to clipboard sharing with WSLg.
Conclusion: Leverage WSLg for its simpler setup process and enjoy seamless clipboard sharing between Windows and Linux.