Ask Your Question

ROS2 node communication across WSL2 border

asked 2021-09-01 11:18:59 -0500

wl gravatar image

updated 2021-09-02 03:31:46 -0500


Windows 10 with all recent updates.

Ubuntu 20.04 inside WSL2 on that Windows. Also, all recent updates.

ROS2 rolling release, installed in Windows 10. The release uses CycloneDDS. For some reason I cannot run neither Foxy, nor Galactic installation. Here is the description of the bug:

ROS2 Galactic, installed on Ubuntu inside WSL2 from Debian packages, recently updated.


Limited communication between ROS2 nodes, running on Windows and on Ubuntu/WSL2.

Default interface

ROS2 node on windows always tries to use Ethernet instead of WSL2 virtual network. This was solved by setting following CycloneDDS config:

<?xml version="1.0" encoding="UTF-8" ?>
<CycloneDDS xmlns="" xmlns:xsi="" xsi:schemaLocation="">
<Domain id="any">
<!--        <Discovery>-->
            <!--<Peer address=""/>-->
            <!--<Peer address=""/>-->

set CYCLONEDDS_URI=c:/work/cyclonedds/cdds_wsl2_win.xml

Similar config has been set for ros2 on Ubuntu/WSL

I've tried commenting and uncommenting "Discovery" tag, the situation doesn't change.



ros2 multicast send
ros2 multicast receive

don't show any output, if one of them is run on Windows and another - on Ubuntu/WSL, no matter, what OS runs receive.

Talker/listener from demo nodes

I've got the following table, showing when the listener listens "Hellos" from the talker. Only two combinations out of 8. Any version of talker on Linux (Python or C++) and C++ listener on Windows.

Windows        Linux     
cpp talker     cpp listener  -> no connection
cpp listener   cpp talker    -> connected!
py talker      py listener    -> no connection
py listener    py talker        -> no connection
py talker      cpp listener    -> no connection
cpp talker     py listener     -> no connection
py listener    cpp talker     -> no connection
cpp listener   py talker      -> connected!


How can I debug and resolve it?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-09-02 09:32:09 -0500

wl gravatar image

The issue was in the windows firewall settings.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2021-09-01 11:18:59 -0500

Seen: 190 times

Last updated: Sep 02 '21