

#Xming xserver windows#
Now WSL2, and only WSL2, is able to send network traffic to Windows on port 6000, which we need for X. These are local subnets that may be used by WSL2. Then click Add again entering "192.168.0.0/16" under port. We now need to narrow the scope so it's only open to WSL2.įind the Rule you just created in the list of Inbound Rules, right click and select "Properties"Ĭlick the "Scope" tab, and under "Remote IP Addresses" click Add entering "172.16.0.0/12" under port.

This opens up the port to the whole internet, which is a security risk. Then click next through windows (allowing the connection and applying to all profiles) until the last screen, and then give it a reasonable name like "WSL2 X Access" and then Finish. Under Rule Type select port and then click next. We're going to open up Port 6000 for the X Server to communicate on. Right click on "Inbound Rules" and select the option "Add Rule." You may be asked at an Administrator prompt to allow this application to make changes to the system allow it. Press the Windows Start Button and select "Firewall & Network Protection" (typing until it comes up). This is straightforward but requires a few steps. We'll enable this traffic to pass through the firewall, as described in cascadium. This means that when we're trying to forward X from WSL2 to an X Server running in Windows it has to pass through the firewall. WSL2 runs in a Virtual Machine, so network traffic looks like it's coming from another machine (as opposed to WSL1 where network traffic was local). Export the appropriate display variables from Linux.

