Skip to content

Latest commit

 

History

History
118 lines (79 loc) · 3.14 KB

File metadata and controls

118 lines (79 loc) · 3.14 KB

Installation of WSL for ROS2 Jazzy

Each ROS2 distribution targets a specific Linux environment. For Jazzy it is Ubuntu 24.04. To run it on Windows 10/11, the WSL2 feature will be used.

Install WSL

Installing WSL (Linux on Windows) is officially supported by Microsoft. For details refer to the following Microsoft documentation.

But all you need is this from a windows power shell:

    wsl --update
    wsl --install -d "Ubuntu-24.04"

NOTE: A Windows message dialog may popup in the background, to ask for elevated rights. Check for such a window if the installation does not progress.

NOTE: If windows requests to restart after trying to install Ubuntu, do so and try to install again.

First time use

A console window should appear with installation messages. It will ask you for a user name and password. Use values you remember, as you need this password later whenever you install software.

Ubuntu First Time

If no window opens, or you get an error message, try rebooting. Windows may require updates to install for WSL. Then start an Ubuntu console from start menu:

Ubuntu Start Menu

If a root shell is started and there was no user created, add a user manually in the linux shell:

    adduser <username>
    usermod -aG sudo <username>

Configure Ubuntu to login by default with your user in the windows power shell:

    ubuntu2404 config --default-user <username>

Checking Installation

Check that you have the right distribution installed (Ubuntu 24.04 LTS):

In the Ubuntu terminal:

    $  lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 24.04 LTS
    Release:        24.04
    Codename:       noble

New Terminal Window

Is is recommended to install the new Microsoft Terminal Window if not done already. It is available from

Github Microsoft Terminal

It offers tabs, history and embeds all kinds of shells (cmd, powershell, Ubuntu, git ...)

New Shell

Exposing WSL Ports to the Network

To make TCP/UDP ports listening in WSL accessible from your local network, follow these steps:

Find your WSL IP address by running this command in WSL:

ip addr show eth0

or this in a windows powershell:

wsl hostname -I

NOTE: TCP/UDP port forwarding to WSL is not supported without mirrored networking (WSL 2.0.0 on win11)

Open a terminal in an administrator shell on Windows. Run the following commands to forward the TCP/UDP port, replacing [PORT] with your desired port number and [WSL_IP] with the IP address.

Port Description
8888 ROS2 network port
netsh interface portproxy add v4tov4 listenport=[PORT] listenaddress=0.0.0.0 connectport=[PORT] connectaddress=[WSL_IP]

To view all forwarded ports:

netsh interface portproxy show all

To remove a port forward:

netsh interface portproxy delete v4tov4 listenport=[PORT] listenaddress=0.0.0.0