Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To establish connectivity between WSL2 and the host using actual IP, follow the steps below:

  1. Check the IP Address of the Host: Open the command prompt on the host machine and type "ipconfig" to check the IP address.

  2. Configure WSL2 network settings: In the WSL2 terminal, type "sudo nano /etc/wsl.conf" to edit the configuration file. Add the following lines:

[network] generateResolvConf = false

This line will prevent WSL2 from generating a new /etc/resolv.conf file

address = <host's ip="" address="">

This line will set the IP address of WSL2 to the same IP address as the host

  1. Restart WSL2: In the WSL2 terminal, type "wsl --shutdown" to shut down WSL2 completely. Then, restart WSL2 by opening the terminal again.

  2. Test connectivity: In the WSL2 terminal, try pinging the host's IP address to ensure connectivity.

By following these steps, you should be able to establish connectivity between WSL2 and the host using actual IP.