But if you run VcXsrv you can use the native Linux clipboard and have it shared between WSL 2 and Windows. This is what I do because then tools like Vim, the pass utility and other command line tools can write to and read from the native Linux clipboard and everything will work out of the box.
If you wanted to reproduce pbcopy / pbpaste in native Linux or WSL 2 you can set up aliases for:
alias pbcopy="xclip -selection clipboard"
alias pbpaste="xclip -o"
And in case you don't already have xclip installed in WSL 2, you can apt-get install xclip or use whatever package manager you have. I can't remember if xclip is installed by default in WSL 2 distros.
Oh that’s neat. Do you use the x server for just this purpose or do you also run linux gui apps? I’ve been thinking about investing more into it but the high dpi stuff does not work properly.
I use it just for the clipboard but I used to run Sublime Text through it years ago (using WSL 1). It was really fast and worked great, at least at 2560x1440.