I know this question is a couple years old but it looks it's frequently viewed so decided to answer it.
Things have improved a lot when running ROS on Windows in the last few years. Yes there are still a few limitations and compatibility issues to deal with but no show stoppers in my opinion.
It may be confusing for someone new to ROS1 or ROS2 on Windows what direction to take as there are more than one:
As of December 2021, this is a response on direction from ROS on Windows:
ros.org is the source of truth for ROS development. the aka.ms/ros documentation was designed to bootstrap Windows development for ROS1 and help bootstrap ROS2. It also documents our first party ROS nodes and development tooling. It does need a refresh.
RoboStack, Open Robotics and Microsoft have collaborated on making RoboStack a first class citizen for ROS2; for all platforms. It needs to be represented on the ros.org website; there is work happening for that.
Windows 11 + WSL2 is a fantastic way of developing simulation if your ultimate target is a Linux based Robot. However, WSL cannot talk directly to hardware (even with the new USB bridge), so it is limited to simulated robots.
Source: https://github.com/ms-iot/ROSOnWindow... by @OoeyGUI
For information on how to use WSL2 in Windows 10 and 11, recommend to follow this tutorial where ROS1 or ROS 2 can be installed: https://www.windowscentral.com/how-in...
For installation of ROS on Windows with Visual Studio, follow this tutorial: http://wiki.ros.org/Installation/Windows
For using RoboStack
for ROS 1 and ROS 2, suggest to visit: https://robostack.github.io/
Also it's possible to use great tools such as VSCode
using ROS extension and is not limited to Windows: https://marketplace.visualstudio.com/... accompanied by many great tutorials: https://github.com/ms-iot/vscode-ros
In summary, if you want to develop ROS in Windows, thing have improved immensely in the last few years. For community support, you can visit: https://github.com/ms-iot/ROSOnWindows as well.
I am not sponsored or work for Microsoft, just a big fan on working on the Windows operating system as I used Visual Studio for many years.
And perhaps I am not answering the original question but hope this helps someone navigate using ROS on Windows.
Just a question, but do you have a particular reason to want to run this in WSL instead of using the native Windows binaries of ROS 2?
It's complicated. Using a Macbook Pro but the latest release of Macos (Catalina) is not officially supported for ROS. Plus I feel uncomfortable having to disable SIP. I'm equally comfortable with Linux, but drivers for mac hardware on linux are pretty terrible. Windows works fine, but I'm far more comfortable with a UNIX-like environment. So that led me to WSL, hoping to get the convenience of linux without having to deal with the bad drivers. If I can't get it to work, I can just use a plain old VM.
I've only used WSL 1, and it was never really 'the same' as a native install. WSL 2 supposedly comes as close as possible due to it just running a regular kernel and everything in a hypervisored-vm.
If you disable the firewall -- for a test -- do things start to work? If so, you could try to configure things such that you don't need to disable it, but still keep a working setup.
Your problem does sound a little like something you should ask the WSL developers/maintainers about (ie: Microsoft). It's essentially just an application running in WSL 2.
@gvdhoorn I can confirm a perfectly working setup in WSL2
@atyshka Have you figured this out? I have the same problem
As stated, it will only work on WSL2. The networking stack in WSL doesn’t support all the Linux features that ros expects
@gvdhoorn I tried to run the nodes with the firewalls disabled and it seems to be working. However, it continued working even after I turned the firewalls on. Don't know how and why it worked.