wsl
filesystem performance is slow#
workaround#
Prefer ~/
over /mnt
when filesystem performance is needed
wsl uses all the ram#
running windows applications in wsl#
integrate beyond compare in wsl#
Inside ~/.gitconfig
:
ini
[diff]
tool = bcomp
[difftool]
prompt = false
[difftool "bcomp"]
path = "/mnt/c/Program\\ Files/Beyond\\ Compare\\ 4/BCompare.exe"
cmd = "/mnt/c/Program\\ Files/Beyond\\ Compare\\ 4/BCompare.exe" "$(wslpath -aw $LOCAL)" "$(wslpath -aw $REMOTE)"
[merge]
tool = bcomp
[mergetool]
prompt = false
[mergetool "bcomp"]
path = "/mnt/c/Program\\ Files/Beyond\\ Compare\\ 4/BCompare.exe"
cmd = "/mnt/c/Program\\ Files/Beyond\\ Compare\\ 4/BCompare.exe" "$(wslpath -aw $LOCAL)" "$(wslpath -aw $REMOTE)" "$(wslpath -aw $BASE)" "$(wslpath -aw $MERGED)"
increase number of open files#
Running into EMFILE
errors because too many files open? (looking at you npm i
):
bash
mylimit=8000
sudo prlimit --nofile=$mylimit --pid $$; ulimit -n $mylimit
su $USER
or
bash
sudo prlimit -p "$$" --nofile=10000:10000
exec $SHELL
ulimit -n 10000
fix clock drift#
WSL2 clock drifts if left open when Windows sleeps. Fix with:
bashsudo hwclock -s
port-forward for external connections#
In powershell, to port-forward:
powershell
netsh interface portproxy add v4tov4 listenport=3000 listenaddress=0.0.0.0 connectport=3000 connectaddress=$ipAddress
To release:
powershell
netsh interface portproxy delete v4tov4 listenport=3000 listenaddress=0.0.0.0
To show all currently configured:
powershellnetsh interface portproxy show all