ROS1 Setup for WSL
A step-by-step guide to installing ROS Noetic on Ubuntu 20.04 via WSL.
1. Prerequisites: WSL & Ubuntu
Check if WSL is already installed and view current distributions. If this command is not recognized or fails, proceed with the steps below.
wsl -l -v
Enable WSL via Windows Features (If command is missing):
1. Press the Windows Key, type Turn Windows features on or off, and press Enter.
2. Scroll down and check the box next to Windows Subsystem for Linux.
3. Check the box for Virtual Machine Platform as well (required for WSL 2).
4. Click OK and restart your computer when prompted.
Install the Windows Subsystem for Linux (WSL) core components. Note: A system restart might be required after this step before installing the actual Ubuntu version.
wsl --install --no-distribution
Install the Ubuntu 20.04 distribution (Required for ROS Noetic)
wsl --install -d Ubuntu-20.04
Update current system package lists
sudo apt update
2. Setup ROS Repositories
Add the official ROS repository to your sources list
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
Install curl utility to download keys
sudo apt install curl -y
Download and add the ROS repository key securely
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
3. Installation
Update package lists again to include the new ROS repository
sudo apt update
Install the full ROS Noetic desktop package (includes 2D/3D simulators and tools)
sudo apt install ros-noetic-desktop-full -y
4. Environment Setup
Automatically source the ROS setup script in every new bash terminal
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
Apply the updated bash profile to your current session
source ~/.bashrc
5. Verification
Start the ROS Master node. If this runs without errors, your installation is complete!
roscore