Return to Level1Techs.com

Connecting internet to WSL2 and Hyper-V

Please excuse my laymen question. I have never had to do this before but I am wanting to have my ethernet internet connection to work within both of these programs.

Could someone please point in the direction of how to do this?

Can you specify a bit about what exactly you want? You get internet access from your hosts physical connection by default.

If you want WSL2 and a HyperV VM to have IP addresses on your Hosts network that requires more configuration.

HyperV vms should allow you to change the virtual network adapter to host which would allow your VM to have an IP address on your host network.

image

See Accessing network applications with WSL | Microsoft Docs for more WSL info.

For me it is more that I cant get hyper v and WSL2 to recognize my internet connection.

Ubuntu on WSL2 for example says it is not connected yet my PC is always connected via my gigabit Ethernet connection.

@WilliamPayne, what version of Ubuntu are you running in WSL2? If it is 17.04 or higher, you might need to configure your ethernet connection manually. Search how to configure Netplan.

Cool ill have a look. I figured it would be something like that.

@WilliamPayne If you have any more questions or trouble setting up Netplan, please feel free to reach out.