Answer the question
In order to leave comments, you need to log in
How to throw WSL2 out?
This question was asked a couple of years ago: https://qna.habr.com/q/906041 and received an answer. Now it was necessary to repeat this, but the method is no longer working, it seems that something has changed during this time.
So there is WSL2 with Debian. Ip: 172.28.45.56, I run it for the test
php -S 0.0.0.0:80
netsh interface portproxy add v4tov4 listenport=80 listenaddress=0.0.0.0 connectport=80 connectaddress=172.28.45.56
Answer the question
In order to leave comments, you need to log in
In Hyper-V Manager - Virtual Switch Manager for virtual switch WSL - set External - then WSL will have to get an external ip address from the same DHCP server as the network card in Windows.
If in WSL it is worth obtaining an address not via DHCP, then
sudo ip addr flush dev eth0
sudo dhclient eth0
If you need to configure it manually, then sudo ip
addr
add 192.168.0.116/24 dev eth0 ://github.com/CzBiX/WSLHostPatcher
wsl2 is a normal virtual machine with hardware virtualization and very strange crooked mapping of the file system to the host (which causes a lot of oddities and problems) and network problems.
to raise a full-fledged virtual machine (standard hiperv or virtualbox) is a matter of ten minutes (debootstrap or deploy a regular installation on a ram disk), so why suffer and solve almost specially created problems from Microsoft?
moreover, later, transferring linux from a virtual machine to new hardware is a couple of gestures, when it’s not so easy as from wsl.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question