Hello!
I switched to WSL2 yesterday and suddenly my web server could not connect to my mongoDB database installed on windows.
I figured it out this morning. Essentially you have to:
I wrote a little bit more details on my blog here.
It had been bothering me for a while now, so I am glad I figured it out. I hope it can help someone else. My next step is to have the X11 server to work again (it was fine on WSL1, but not anymore).